Nov 13, 2012, 10:09 PM
[MVC] How to get the initial data from an edited FormPanel and send it to the controller?
I have a FormPanel that gets filled with editable data upon selecting a row in a GridPanel (like this example).
I want to send the initial data from the form panel, as well as any edited data, from the View to the Controller when the "save" button is pressed, so that I can compare the changes:
The form is initially filled from a passed in @model System.Data.DataTable. I know I could probably get the values from this DataTable again, but I am new to Ext.Net, Asp.Net, C#, and MVC, and I just don't know how to do that in code.
I want to send the initial data from the form panel, as well as any edited data, from the View to the Controller when the "save" button is pressed, so that I can compare the changes:
public void Compare(FormCollection newValues, FormCollection oldValues)
{...}
I know that I can send the newValues like this:.Listeners(listener => {
listener.Click.Handler = @"this.up('form').submit({
success : function (form, action) {
eval(action.result.script);
}});";
})
but how can I get and send the oldValues? The form is initially filled from a passed in @model System.Data.DataTable. I know I could probably get the values from this DataTable again, but I am new to Ext.Net, Asp.Net, C#, and MVC, and I just don't know how to do that in code.
Last edited by KBorkiewicz; Nov 13, 2012 at 10:13 PM.