Feb 02, 2012, 1:44 PM
[CLOSED] How to "commit" changes to Grid on the client side?
Hi,
I have a master-detail GridPanel / FormPanel relationship on the page. On the click of the "Save" button, I now do three things:
Is there any call to client "commit" the changes to the Grid?
Thanks,
Vadym
I have a master-detail GridPanel / FormPanel relationship on the page. On the click of the "Save" button, I now do three things:
<ext:Button ID="ButtonSave" runat="server" Text="Save" Icon="Disk">
<DirectEvents>
<Click Before="updateRecord(#{FormPanel1});" OnEvent="ButtonSave_Click" After="#{GridPanel1}.store.reload();">
<EventMask ShowMask="true" />
</Click>
</DirectEvents>
</ext:Button>
<head runat="server">
<script type="text/javascript">
var updateRecord = function (form) {
if (form.record == null) {
return;
}
form.getForm().updateRecord(form.record);
};
</script>
</head>
<script runat="server">
protected void ButtonSave_Click(object sender, DirectEventArgs e)
{
// Commit the changes to the database
}
</script>
The call to updateRecord() obviously updates the corresponding record in the GridPanel with the changes from the FormPanel. At that point, the Grid is in uncommitted state. So even after the saving code in the button click DirectEvent is executed, I have to reload the Grid store in the "After" handler to avoid viewing the "You have uncommitted changes..." message when manually refreshing the Grid.Is there any call to client "commit" the changes to the Grid?
Thanks,
Vadym
Last edited by Daniil; Feb 02, 2012 at 3:25 PM.
Reason: [CLOSED]