Ext.Net - Update Store Item With Combobox Text and Value
Simple, I have a GridPanel and a FormPanel. Inside the form there is a combobox with a separate store. The GridPanel has another Store. The store items have a PersonName and PersonId properties. I would like to know how do I up开发者_StackOverflow社区date those two properties with the combobox text to PersonName and value to PersonId respectively when I save the form changes.
Thanks!
Do you mean something like this?:
<ext:GridPanel runat="server" ID="gridTest" StoreID="storeData">
<ColumnModel>
<Columns>
<ext:Column DataIndex="personId" Header="Person">
<Editor>
<ext:ComboBox runat="server" StoreID="storePeople" ValueField="personId" DisplayField="personName" />
</Editor>
</ext:Column>
</Columns>
</ColumnModel>
</ext:GridPanel>
This will allow you to select the name corresponding to an ID. The trick here is that in the grid though, it will show the ID number; not the name. To get it to show the name, you need to add a renderer onto the column to tell it to show a different value from the one it is bound to.
精彩评论