PDA

View Full Version : GridPanel - Editable - Combo Box Shows Value instead of Label



Dennis
May 27, 2020, 8:59 PM
Hello,
I have a Combo Box Field in the Grid Panel. I am having trouble making the combo box show the label when the page is loaded. Once I click on the Combo box control - it does show list of labels, but when I select one it goes back to showing the value.

My Code:




protected void Page_Load(object sender, EventArgs e)
{

LoadStatuses();

if (!X.IsAjaxRequest)
{
this.BindData();
}

}

private void LoadStatuses()
{
this.cbStatuses.Items.Add(new Ext.Net.ListItem("Pending", 1));
this.cbStatuses.Items.Add(new Ext.Net.ListItem("Accepted", 4));
this.cbStatuses.Items.Add(new Ext.Net.ListItem("Rejected", 7));
}


Column Definition:


<ext:Column runat="server" DataIndex="TransferStatus_ID" Text="Status Select" Width="200">
<Editor>
<ext:ComboBox ID="cbStatuses" runat="server" />
</Editor>
</ext:Column>

Please asvise.

Thanks,
Dennis.

fabricio.murta
May 27, 2020, 10:09 PM
Hello @Dennis!

Please wrap your code around
blocks (select it and click the # button in the toolbar).

And try using a store with data instead of items -- especially if you want to change this data on the run. If not sure what I'm talking about, take a look at the combo box examples on Examples Explorer, most are fed by data in stores tied to them. A good starting point would be the Forms > ComboBox > Overview example (https://examples5.ext.net/#/Form/ComboBox/Overview/).

In your case probably just setting DisplayField="Text" to the combo box should suffice. But again if you want to have a server-driven, non-fixed amount of entries in your combo box, you should use a store.

Hope this helps!

Dennis
May 28, 2020, 3:01 PM
Hi Fabricio,
I set DisplayField = "Text". still same result. I also tried to use "Store" for the combo box, example of which I found in one of the posts on the forum - got same result. here is the full source of what I have now:
Test.aspx


<ext:ResourceManager runat="server" />

<asp:ScriptManager runat="server" EnablePageMethods="true" EnablePartialRendering="true">
<Scripts>
<asp:ScriptReference Path="~/Scripts/ExtNet/PageFunctions.js" />
</Scripts>
</asp:ScriptManager>

<h1>Editable GridPanel With Save To [DirectMethod]</h1>

<ext:GridPanel
ID="GridPanel1"
runat="server"
Title="Editable GridPanel"
Width="700"
Height="350">
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server" IDProperty="ID">
<Fields>
<ext:ModelField Name="ID" Type="Int" />
<ext:ModelField Name="Name" />
<ext:ModelField Name="Number" />
<ext:ModelField Name="Note" />
<ext:ModelField Name="NumberNew" />
<ext:ModelField Name="NameNew" />
<ext:ModelField Name="Note" />
<ext:ModelField Name="TransferStatus_ID" Type="Int" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column runat="server" Text="ID" DataIndex="ID" Width="35" />
<ext:Column runat="server" Text="Name" DataIndex="Name" Flex="1">
</ext:Column>
<ext:Column runat="server" Text="Number" DataIndex="Number" Flex="1">
</ext:Column>
<ext:Column runat="server" Text="Name New" DataIndex="NameNew" Flex="1">
<Editor>
<ext:TextField runat="server" />
</Editor>
</ext:Column>
<ext:Column runat="server" Text="Number New" DataIndex="NumberNew" Flex="1">
<Editor>
<ext:TextField runat="server" />
</Editor>
</ext:Column>
<ext:Column runat="server" Text="Note" DataIndex="Note" Flex="1">
<Editor>
<ext:TextField runat="server" />
</Editor>
</ext:Column>
<ext:Column runat="server" DataIndex="TransferStatus_ID" Text="Status Select" Width="200">
<Editor>
<ext:ComboBox ID="cbStatuses" runat="server" DisplayField="Text" />
</Editor>
</ext:Column>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:CellSelectionModel runat="server" />
</SelectionModel>
<Plugins>
<ext:CellEditing runat="server">
<Listeners>
<Edit Fn="edit" />
</Listeners>
</ext:CellEditing>
</Plugins>
</ext:GridPanel>


Test.cs


protected void Page_Load(object sender, EventArgs e)
{
LoadStatuses();

if (!X.IsAjaxRequest)
{
this.BindData();
}

}

private void LoadStatuses()
{
this.cbStatuses.Items.Add(new Ext.Net.ListItem("Pending", 1));
this.cbStatuses.Items.Add(new Ext.Net.ListItem("Accepted", 4));
this.cbStatuses.Items.Add(new Ext.Net.ListItem("Rejected", 7));
}

private void BindData()
{
Store store = this.GridPanel1.GetStore();
store.DataSource = this.GetDataNew();
store.DataBind();
}


I also tried to create an object list as data source for the combo box (I specified display field and value field) - got same result.

Thanks,
Dennis.

fabricio.murta
May 29, 2020, 4:48 PM
Hello Dennis!

You forgot to add the stub/mock implementation for a GetDataNew() that is sufficient to reproduce the issue.

Looking forward to your follow-up!

Dennis
May 29, 2020, 6:26 PM
Here it is:


private List<Data.Client> GetDataNew()
{
pi = new Data.ProjectInventory(4, 1);
List<Data.Client> clntList = pi.GetClientsList();

return clntList;
}


GetClientsList()



sql = "select * from vwClients where Project_ID = @projectid";
sqlparams = new object[] { "@projectid", this.ProjectID };

dtClients = sdm.ExecuteDataTable(sql, sqlparams);

clntList = (from DataRow dr in dtClients.Rows
select new Client()
{
ID = Convert.ToInt32(dr["Client_ID"]),
Name = dr["ClientName"].ToString(),
Number = dr["ClientNumber"].ToString(),
Note = dr["Note"].ToString(),
NumberNew = dr["CLientNumber_Overlay"].ToString(),
NameNew = dr["ClientName_Overlay"].ToString(),
TransferStatus_ID = Convert.ToInt32(dr["TransferStatus_ID"])
}).ToList();

return clntList;


Thanks,
Dennis.

fabricio.murta
Jun 01, 2020, 2:18 PM
Hello @Dennis.

Can you provide a small set of mock data this clntList variable should have? It doesn't help much having the method implementation if it requires a database connection and data to work. We'd need a stub. We don't have the implementation for Data.Client either. A simple class/struct with the fields that are used for the mock data should suffice.

Dennis
Jun 01, 2020, 5:12 PM
Fabricio, here it is.


public class Client
{
public int ID { get; set; }
public string Name { get; set; }
public string Number { get; set; }
public string NameNew { get; set; }
public string NumberNew { get; set; }
public int TransferStatus_ID { get; set; }
public string Note { get; set; }
}


Data Sample


CLient_ID ClientName ClientNumber ClientName_Overlay ClientNumber_Overlay TransferStatus_ID Note
10 My Test Client 1 00001 NULL NULL 7 NULL
11 My Test Client 2 00002 NULL NULL 7 NULL


TransferStatus_ID is 7 for both clients.

Status lookup data:


Pending, 1
Accepted, 4
Rejected, 7


Fabricio, if that is easier, would you be able to provide an example or point me at one - where there is a grid panel with a (value/label) combo box field?

Thanks,
Dennis.

Dennis
Jun 05, 2020, 4:37 PM
Fabricio, can you point me to where I can find an example I am looking for?

Thanks,
Dennis.

fabricio.murta
Jun 05, 2020, 5:05 PM
Hello Dennis!

Sorry I couldn't get down to your test case yet, if you are able to compile that into a single runnable test case, it would make things easier for us to reproduce the scenario and give you feedback on how to handle that scenario.

If in doubt how to come up with test cases, please review our forum guidelines threads.

- Tips for creating simplified code samples (http://forums.ext.net/showthread.php?61176-Tips-for-creating-simplified-code-samples)
- More Information Required (http://forums.ext.net/showthread.php?10205-More-Information-Required)
- Forum Guidelines (http://forums.ext.net/showthread.php?3440-Forum-Guidelines-For-Posting-New-Topics)

As for your example request, I have this list of examples, all contains ext:ComboBox and all references DisplayField. The filter is quite simple so not necessarily in all samples the DisplayField is specified to the combo boxes (I checked the first example of the list and it does, though). So before you consider the example, check if it has a ComboBox defining the property before anything else.

- DataView > ComponentView > Editor (https://examples5.ext.net/#/DataView/ComponentView/Editor/)
- Data_Binding > Basic > Chained_Combos (https://examples5.ext.net/#/Data_Binding/Basic/Chained_Combos/)
- Data_Binding > Basic > Chaining_Selection (https://examples5.ext.net/#/Data_Binding/Basic/Chaining_Selection/)
- Events > Listeners > Arguments (https://examples5.ext.net/#/Events/Listeners/Arguments/)
- Form > ComboBox > Ajax_Linked_Combos (https://examples5.ext.net/#/Form/ComboBox/Ajax_Linked_Combos/)
- Form > ComboBox > Custom_Drop_Down_List (https://examples5.ext.net/#/Form/ComboBox/Custom_Drop_Down_List/)
- Form > ComboBox > Custom_Search (https://examples5.ext.net/#/Form/ComboBox/Custom_Search/)
- Form > ComboBox > IconCombo (https://examples5.ext.net/#/Form/ComboBox/IconCombo/)
- Form > ComboBox > Items_Actions (https://examples5.ext.net/#/Form/ComboBox/Items_Actions/)
- Form > ComboBox > Linked_ComboBoxes (https://examples5.ext.net/#/Form/ComboBox/Linked_ComboBoxes/)
- Form > ComboBox > Linked_Combos_In_Grid (https://examples5.ext.net/#/Form/ComboBox/Linked_Combos_In_Grid/)
- Form > ComboBox > Overview (https://examples5.ext.net/#/Form/ComboBox/Overview/)
- Form > ComboBox > Two_Columns (https://examples5.ext.net/#/Form/ComboBox/Two_Columns/)
- Form > FieldContainer > Overview (https://examples5.ext.net/#/Form/FieldContainer/Overview/)
- Form > Miscellaneous > Checkout_Form (https://examples5.ext.net/#/Form/Miscellaneous/Checkout_Form/)
- Form > Miscellaneous > Data_Binding (https://examples5.ext.net/#/Form/Miscellaneous/Data_Binding/)
- Form > Triggers > Trigger_with_Dialog_Editor (https://examples5.ext.net/#/Form/Triggers/Trigger_with_Dialog_Editor/)
- Getting_Started > Introduction > Component_Overview (https://examples5.ext.net/#/Getting_Started/Introduction/Component_Overview/)
- GridPanel > Data_Presentation > Editor_Field_Mapping (https://examples5.ext.net/#/GridPanel/Data_Presentation/Editor_Field_Mapping/)
- GridPanel > Data_Presentation > MultiCombo_Map (https://examples5.ext.net/#/GridPanel/Data_Presentation/MultiCombo_Map/)
- GridPanel > FilterHeader > Mapped_Field_Filtering (https://examples5.ext.net/#/GridPanel/FilterHeader/Mapped_Field_Filtering/)
- GridPanel > Miscellaneous > Details_Window (https://examples5.ext.net/#/GridPanel/Miscellaneous/Details_Window/)
- GridPanel > Miscellaneous > Details_Window_Remote (https://examples5.ext.net/#/GridPanel/Miscellaneous/Details_Window_Remote/)
- GridPanel > MultiHeader > Filter (https://examples5.ext.net/#/GridPanel/MultiHeader/Filter/)
- GridPanel > MultiHeader > Overview (https://examples5.ext.net/#/GridPanel/MultiHeader/Overview/)
- Kitchen_Sink > Forms > Register (https://examples5.ext.net/#/Kitchen_Sink/Forms/Register/)
- Miscellaneous > Bin_HtmlBin > Overview (https://examples5.ext.net/#/Miscellaneous/Bin_HtmlBin/Overview/)

You may want to start from the Form > Combo Box examples, and/or the overview, basic or simple ones.

Sorry it is a lot of examples, that's what I could gather in the earnest, and hope you can find examples that help you there. Notice this is noticeable less than the 750+ examples around our Examples Explorer, so should be helpful. :)

Hope this helps!

Dennis
Jun 09, 2020, 7:16 PM
Hi Fabricio,
I have put together example with sample data, etc. It can be put in Visual studio and run as a stand alone app. Please take a look (You should see the ID of the status instead of the description in the combobox field on the far right):

Test.aspx


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="LateralTransfer.Test" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">

<ext:ResourceManager runat="server" />

<asp:ScriptManager runat="server" EnablePageMethods="true" EnablePartialRendering="true">
<Scripts>
<asp:ScriptReference Path="~/Scripts/ExtNet/PageFunctions.js" />
</Scripts>
</asp:ScriptManager>

<h1>Editable GridPanel With Save To [DirectMethod]</h1>

<ext:GridPanel
ID="GridPanel1"
runat="server"
Title="Editable GridPanel"
Width="700"
Height="350">
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server" IDProperty="ID">
<Fields>
<ext:ModelField Name="ID" Type="Int" />
<ext:ModelField Name="Name" />
<ext:ModelField Name="Number" />
<ext:ModelField Name="Note" />
<ext:ModelField Name="NumberNew" />
<ext:ModelField Name="NameNew" />
<ext:ModelField Name="Note" />
<ext:ModelField Name="TransferStatus_ID" Type="Int" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column runat="server" Text="ID" DataIndex="ID" Width="35" />
<ext:Column runat="server" Text="Name" DataIndex="Name" Flex="1">
</ext:Column>
<ext:Column runat="server" Text="Number" DataIndex="Number" Flex="1">
</ext:Column>
<ext:Column runat="server" Text="Name New" DataIndex="NameNew" Flex="1">
<Editor>
<ext:TextField runat="server" />
</Editor>
</ext:Column>
<ext:Column runat="server" Text="Number New" DataIndex="NumberNew" Flex="1">
<Editor>
<ext:TextField runat="server" />
</Editor>
</ext:Column>
<ext:Column runat="server" Text="Note" DataIndex="Note" Flex="1">
<Editor>
<ext:TextField runat="server" />
</Editor>
</ext:Column>
<ext:Column runat="server" DataIndex="TransferStatus_ID" Text="Status Select" Width="200">
<Editor>
<ext:ComboBox ID="cbStatuses" runat="server" />
</Editor>
</ext:Column>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:CellSelectionModel runat="server" />
</SelectionModel>
<Plugins>
<ext:CellEditing runat="server">
<Listeners>
<Edit Fn="edit" />
</Listeners>
</ext:CellEditing>
</Plugins>
</ext:GridPanel>
</form>
</body>
</html>



Test.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;

namespace LateralTransfer
{
public partial class Test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
LoadStatuses();

if (!X.IsAjaxRequest)
{
this.BindData();
}

}

private void LoadStatuses()
{
this.cbStatuses.Items.Add(new Ext.Net.ListItem("Pending", 1));
this.cbStatuses.Items.Add(new Ext.Net.ListItem("Accepted", 4));
this.cbStatuses.Items.Add(new Ext.Net.ListItem("Rejected", 7));
}

private void BindData()
{
Store store = this.GridPanel1.GetStore();
store.DataSource = this.GetDataNew();
store.DataBind();
}

private List<Data.Client> GetDataNew()
{
List<Data.Client> clntList = new List<Data.Client>();

clntList.Add(new Data.Client() { ID = 10, Name = "Client1", Number = "01", Note = "Client 1 Note", NumberNew = "01", NameNew = "Client1", TransferStatus_ID = 7 });
clntList.Add(new Data.Client() { ID = 11, Name = "Client2", Number = "02", Note = "Client 2 Note", NumberNew = "02", NameNew = "Client2", TransferStatus_ID = 7 });

return clntList;
}

[DirectMethod(Namespace = "ClientX")]
public void EditNew(int id, string field, string oldValue, string newValue, object customer)
{
string message = "<b>Property:</b> {0}<br /><b>Field:</b> {1}<br /><b>Old Value:</b> {2}<br /><b>New Value:</b> {3}";

// Send Message...
X.Msg.Notify(new NotificationConfig()
{
Title = "Edit Record #" + id.ToString(),
Html = string.Format(message, id, field, oldValue, newValue),
Width = 250,
Height = 150
}).Show();

this.GridPanel1.GetStore().GetById(id).Commit();
}

}
}


PageFunctions.js


var template = 'color:{0};';

var change = function (value, meta) {
meta.style = Ext.String.format(template, (value > 0) ? "green" : "red");
return value;
};

var pctChange = function (value, meta) {
meta.style = Ext.String.format(template, (value > 0) ? "green" : "red");
return value + "%";
};

var edit = function (editor, e) {
/*
"e" is an edit event with the following properties:

grid - The grid
record - The record that was edited
field - The field name that was edited
value - The value being set
originalValue - The original value for the field, before the edit.
row - The grid table row
column - The grid Column defining the column that was edited.
rowIdx - The row index that was edited
colIdx - The column index that was edited
*/

// Call DirectMethod
//alert(e.value);
if (!(e.value === e.originalValue || (Ext.isDate(e.value) && Ext.Date.isEqual(e.value, e.originalValue)))) {
ClientX.EditNew(e.record.data.ID, e.field, e.originalValue, e.value, e.record.data);
}
};


Thanks,
Dennis.

fabricio.murta
Jun 10, 2020, 10:13 PM
Hello @Dennis!

You missed the definition of Client.Data, and I am assuming a simple wrap-up like this should work:



public class Data
{
public class Client
{
public int ID { get; set; }
public string Name { get; set; }
public string Number { get; set; }
public string Note { get; set; }
public string NumberNew { get; set; }
public string NameNew { get; set; }
public int TransferStatus_ID { get; set; }
}
}


Then I compiled your sample in a single-file code, which seems to work for me (I will paste the compiled version last in the post). Please consider reviewing it should it help you post test cases in the future (simpler one file than several, right?).

Anyway, I finally can understand your issue -- I believe. The combo box is correct. There's no issue with it at all. If I double-click a cell in the last column, the combo box shows the correct display field. What I believe you are having trouble with, is to have the cell display the corresponding string to the number it originally has.

For that, you'd need to use a renderer to map the displayed value in the cell. You can still use the combo store to do the mapping.

An example of a renderer you could use in your example is what follows:

1: add this javascript function to your javascript bundle


var translateTransferStatus = function (value, meta) {
var store = App.cbStatuses.getStore(),
record_id = store.find('field1', value),
record, translatedValue;

if (record_id >= 0) {
record = store.getAt(record_id);
translatedValue = record.get('field2');
} else {
translatedValue = "Unknown (" + value + ")";
}

return translatedValue;
}


2: To the Status Select column, add a renderer referencing to that function above


<Renderer Fn="translateTransferStatus" />


Then always, just before the cell is "printed" on screen (rendered), it will pull the corresponding value given the ID straight from the combo box's store -- or print Unknown (N) if it couldn't find a corresponding entry in the combo box.

With these changes, and also adding another row with a client having a number not corresponding do a valid entry in the combo box, the "compiled" example based on what you provided would be:



<%@ Page Language="C#" %>

<script runat="server">
public class Data
{
public class Client
{
public int ID { get; set; }
public string Name { get; set; }
public string Number { get; set; }
public string Note { get; set; }
public string NumberNew { get; set; }
public string NameNew { get; set; }
public int TransferStatus_ID { get; set; }
}
}

protected void Page_Load(object sender, EventArgs e)
{
LoadStatuses();

if (!X.IsAjaxRequest)
{
this.BindData();
}

}

private void LoadStatuses()
{
this.cbStatuses.Items.Add(new Ext.Net.ListItem("Pending", 1));
this.cbStatuses.Items.Add(new Ext.Net.ListItem("Accepted", 4));
this.cbStatuses.Items.Add(new Ext.Net.ListItem("Rejected", 7));
}

private void BindData()
{
Store store = this.GridPanel1.GetStore();
store.DataSource = this.GetDataNew();
store.DataBind();
}

private List<Data.Client> GetDataNew()
{
List<Data.Client> clntList = new List<Data.Client>();

clntList.Add(new Data.Client() { ID = 10, Name = "Client1", Number = "01", Note = "Client 1 Note", NumberNew = "01", NameNew = "Client1", TransferStatus_ID = 7 });
clntList.Add(new Data.Client() { ID = 11, Name = "Client2", Number = "02", Note = "Client 2 Note", NumberNew = "02", NameNew = "Client2", TransferStatus_ID = 7 });
clntList.Add(new Data.Client() { ID = 12, Name = "Client5", Number = "04", Note = "Client 5 Note", NumberNew = "08", NameNew = "Client7", TransferStatus_ID = 17 });

return clntList;
}

[DirectMethod(Namespace = "ClientX")]
public void EditNew(int id, string field, string oldValue, string newValue, object customer)
{
string message = "<b>Property:</b> {0}<br /><b>Field:</b> {1}<br /><b>Old Value:</b> {2}<br /><b>New Value:</b> {3}";

// Send Message...
X.Msg.Notify(new NotificationConfig()
{
Title = "Edit Record #" + id.ToString(),
Html = string.Format(message, id, field, oldValue, newValue),
Width = 250,
Height = 150
}).Show();

this.GridPanel1.GetStore().GetById(id).Commit();
}
</script>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
var template = 'color:{0};';

var change = function (value, meta) {
meta.style = Ext.String.format(template, (value > 0) ? "green" : "red");
return value;
};

var pctChange = function (value, meta) {
meta.style = Ext.String.format(template, (value > 0) ? "green" : "red");
return value + "%";
};

var edit = function (editor, e) {
/*
"e" is an edit event with the following properties:

grid - The grid
record - The record that was edited
field - The field name that was edited
value - The value being set
originalValue - The original value for the field, before the edit.
row - The grid table row
column - The grid Column defining the column that was edited.
rowIdx - The row index that was edited
colIdx - The column index that was edited
*/

// Call DirectMethod
//alert(e.value);
if (!(e.value === e.originalValue || (Ext.isDate(e.value) && Ext.Date.isEqual(e.value, e.originalValue)))) {
ClientX.EditNew(e.record.data.ID, e.field, e.originalValue, e.value, e.record.data);
}
};

var translateTransferStatus = function (value, meta) {
var store = App.cbStatuses.getStore(),
record_id = store.find('field1', value),
record, translatedValue;

if (record_id >= 0) {
record = store.getAt(record_id);
translatedValue = record.get('field2');
} else {
translatedValue = "Unknown (" + value + ")";
}

return translatedValue;
}
</script>
</head>
<body>
<form id="form1" runat="server">

<ext:ResourceManager runat="server" />

<asp:ScriptManager runat="server" EnablePageMethods="true" EnablePartialRendering="true">
<Scripts>
<asp:ScriptReference Path="~/Scripts/ExtNet/PageFunctions.js" />
</Scripts>
</asp:ScriptManager>

<h1>Editable GridPanel With Save To [DirectMethod]</h1>

<ext:GridPanel
ID="GridPanel1"
runat="server"
Title="Editable GridPanel"
Width="700"
Height="350">
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server" IDProperty="ID">
<Fields>
<ext:ModelField Name="ID" Type="Int" />
<ext:ModelField Name="Name" />
<ext:ModelField Name="Number" />
<ext:ModelField Name="Note" />
<ext:ModelField Name="NumberNew" />
<ext:ModelField Name="NameNew" />
<ext:ModelField Name="Note" />
<ext:ModelField Name="TransferStatus_ID" Type="Int" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column runat="server" Text="ID" DataIndex="ID" Width="35" />
<ext:Column runat="server" Text="Name" DataIndex="Name" Flex="1">
</ext:Column>
<ext:Column runat="server" Text="Number" DataIndex="Number" Flex="1">
</ext:Column>
<ext:Column runat="server" Text="Name New" DataIndex="NameNew" Flex="1">
<Editor>
<ext:TextField runat="server" />
</Editor>
</ext:Column>
<ext:Column runat="server" Text="Number New" DataIndex="NumberNew" Flex="1">
<Editor>
<ext:TextField runat="server" />
</Editor>
</ext:Column>
<ext:Column runat="server" Text="Note" DataIndex="Note" Flex="1">
<Editor>
<ext:TextField runat="server" />
</Editor>
</ext:Column>
<ext:Column runat="server" DataIndex="TransferStatus_ID" Text="Status Select" Width="200">
<Editor>
<ext:ComboBox ID="cbStatuses" runat="server" />
</Editor>
<Renderer Fn="translateTransferStatus" />
</ext:Column>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:CellSelectionModel runat="server" />
</SelectionModel>
<Plugins>
<ext:CellEditing runat="server">
<Listeners>
<Edit Fn="edit" />
</Listeners>
</ext:CellEditing>
</Plugins>
</ext:GridPanel>
</form>
</body>
</html>


Hope this helps!

Dennis
Jun 11, 2020, 1:24 PM
Thank you Fabricio - that worked!
I have one more question. As I understand - In the Edit function the following call is supposed to commit the changes within the Store. How do I subscribe to the update event to have my code notified of the changes so that I could make updates in the underlying DB? What is the best way of doing that?

this.GridPanel1.GetStore().GetById(id).Commit();

Thanks,
Dennis.

geoffrey.mcgill
Jun 11, 2020, 3:14 PM
Hi Dennis. Looks like you're changing the subject of the original thread, so it would be best to start a new thread with your new question.

Please ensure you wrap code samples in [CODE] tags.