Hello Expert,
I have a grid that allow user to add new row or update data. However, I want the data post to the Server when the 'Done' button on the row is click. In the other word, I don't want batch update. I could not find any example on your website.
Thank you
Hello Phoeng,
Thank you for posting in our community.
By igGrid Updating feature uses transactions to log any changes made to the grid. These transactions are kept locally in the browser until the igGrid.saveChanges method is called to send POST request to the server. In regards to this, what I can suggest for achieving your requirement is handling editRowEnded event of the Updating feature. This event if fired after end row editing. There you could call the saveChanges method. For example:
features: [ . . . { name: "Updating", editRowEnded: function(evt, ui){ $("#grid").igGrid("saveChanges"); }, . . . . } ]
I also believe the you will find the following article from our documentation helpful:
Updating Overview(igGrid)
Please let me know if you need any further assistance regarding this matter.
Thank you for the response. However, I have the Hierarchy grid, and I would like to attach the Event in the Codebehid (Controller). Do you have any idea how to get the Id for the Hierarchy grid and attach the event in the code?
internal static GridColumnLayoutModel CreateAssociatedObjectGrid(string handler_name, string row_id) { // Create associated object grid GridColumnLayoutModel gridLayout = new GridColumnLayoutModel(); // Define parameters gridLayout.Caption = "Notes"; gridLayout.Key = "NoteSid"; gridLayout.PrimaryKey = "NoteSid"; gridLayout.Columns.Add(new GridColumn() { HeaderText = "NoteSid", Key = "NoteSid", DataType = "string" }); gridLayout.Columns.Add(new GridColumn() { HeaderText = "Note", Key = "NoteDescription", DataType = "string" }); gridLayout.AutoCommit = true; // Apply features //GridUiHelper.ApplyFeatures(gridLayout, handler_name, row_id); gridLayout.DataSourceUrl = "some url"; gridLayout.UpdateUrl = "some url"; gridLayout.Features.Add(new GridHiding() { Inherit = true, ColumnSettings = new List<ColumnHidingSetting>() { new ColumnHidingSetting() { ColumnKey = "NoteSid", AllowHiding = false, Hidden = true } } }); gridLayout.Features.Add(new GridUpdating() { EditMode = GridEditMode.Row, ColumnSettings = new List<ColumnUpdatingSetting>() { new ColumnUpdatingSetting(){ColumnKey = "NoteDescription", EditorType = ColumnEditorType.Text, Required = true} } }); // Return finished associated object grid return gridLayout; }