Aug 02, 2012, 7:33 PM
[CLOSED] How to get the value for the IdProperty in a Model
Hi,
Currently I have a js that deletes a selected row in a GridPanel. I would like to retrieve the value of the IdProperty(ProductId in my case) for the selected row.
Can you please show me how to get it? I tried using
Below is the code:
Currently I have a js that deletes a selected row in a GridPanel. I would like to retrieve the value of the IdProperty(ProductId in my case) for the selected row.
Can you please show me how to get it? I tried using
sm.selected.get.IdProperty
but returned me a "object underfine" error message.Below is the code:
var deleteProduct = function(sender, args, record, value, rec) {
var grid = #{grdProducts};
Ext.Msg.confirm("Confirm", "Are you sure you wish to remove the selected products?", function(result) {
if (result == "yes") {
debugger;
sm = grid.getSelectionModel();
var test = sm.selected.get.IdProperty;
grid.store.remove(sm.getSelection());
}
});
}
Below is my Model markup: <Model>
<ext:Model runat="server" Name="Products" IDProperty="ProductId">
<Fields>
<ext:ModelField Name="UPCCode" Type="String" />
<ext:ModelField Name="DamageCount" Type="Int" />
</Fields>
</ext:Model>
</Model>
Last edited by Daniil; Aug 03, 2012 at 3:07 PM.
Reason: [CLOSED]