[CLOSED] Update grid cell value without store.reload()

  1. #1

    [CLOSED] Update grid cell value without store.reload()

    I am trying to update a single cell in a grid on a row editor's AfterEdit Success. I am trying to avoid calling store.reload() as I do not want to make a server call. I've tried to use this.record.data.TestColumn = "TestValue"; and even though it does update the data, it is not reflected in the cell. Refreshing the GridView did not help either.
    Last edited by Daniil; Nov 07, 2011 at 7:39 AM. Reason: [CLOSED]
  2. #2

    Refreshing a grid's view should help. Please clarify how does you do that?

    As well please try:
    this.record.set("TestColumn", "TestValue");
  3. #3
    Here's the code I'm using, still doesn't seem to work:

    <%@ Page Language="C#" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <script runat="server">
    	protected void Page_Load(object sender, EventArgs e)
    		if (!X.IsAjaxRequest)
    			var data = this.GetData();
    			var store1 = this.gridMain.GetStore();
    			store1.DataSource = data;
    	public object[] GetData()
    		return new object[] {
                new object[] { "3m Co" },
                new object[] { "Alcoa Inc" },
                new object[] { "Altria Group Inc" },
                new object[] { "American Express Company" },
                new object[] { "American International Group, Inc." },
                new object[] { "AT&T Inc." }
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    <html xmlns="http://www.w3.org/1999/xhtml">
    	<form id="Form1" runat="server">
    	<ext:ResourceManager ID="ResourceManager1" runat="server" />
    	<ext:GridPanel ID="gridMain" runat="server" StripeRows="true" TrackMouseOver="true"
    		Width="600" Height="350" AutoExpandColumn="Company">
    			<ext:Store ID="Store1" runat="server">
    							<ext:RecordField Name="Company" />
    							<ext:RecordField Name="TestColumn" />
    		<ColumnModel ID="ColumnModel1" runat="server">
    				<ext:Column ColumnID="Company" Header="Company" Width="160" DataIndex="Company">
    						<ext:TextField ID="txtCompany" DataIndex="Company">
    				<ext:Column ColumnID="TestColumn" Header="TestColumn" Width="160" DataIndex="TestColumn" />
    			<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" />
    			<ext:GridView ID="GridView1" runat="server">
    			<ext:RowEditor runat="server">
    					<AfterEdit Success="this.record.set('TestColumn', 'TestValue'); #{gridMain}.getView().refresh();">
  4. #4
    A scope of a Success handler is not a RowEditor.

    To get it working please replace:
    And you don't need to call the .refresh() method, if you use the record's .set() method.

Similar Threads

  1. reload store (grid) from treepanel
    By simbal in forum 1.x Help
    Replies: 1
    Last Post: Apr 28, 2012, 9:57 AM
  2. Replies: 1
    Last Post: Dec 22, 2011, 6:17 AM
  3. [CLOSED] reload store and grid on client side
    By ryan.kim in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Aug 12, 2011, 12:39 PM
  4. [CLOSED] Reset store's sort info on grid reload/reconfigure
    By jchau in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Aug 10, 2010, 4:06 PM
  5. [CLOSED] [1.0] Paged grid displays all records on store's reload
    By danielg in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 25, 2010, 11:26 AM

Posting Permissions