Hi,
I would like to have the entered value data[0]["cntRelation"] to be always = "Test" even when I enter new values to my grid.
Now when I edit my grid the new entry comes first (in the order of the ["cntRelation"]. What I want is I always want for the new entry to be the last in the order and the value "Test" always the first.
Below is the declaration of my igGrid
$.ig.loader({ scriptPath: './js/', cssPath: './css/', resources: 'igGrid.*', ready: function () { $.getJSON("Home/GetAll", null, function (data) {
var headerTextValues = [, "Name", "Relation to Will maker"]; $('#contactGrid').igGrid({ expandCollapseAnimations: true, animationDuration: 1000, expandTooltip: "Expand to View Details", collapseTooltip: "Hide details", height: "400px", width: "800px", dataSource: data, responseDataKey: "Records", autoGenerateLayouts: false, autoGenerateColumns: false, //to not generate all column and show only the ones i want to display rowEditDialogContainment: "owner", showReadonlyEditors: false, columns: [ { headerText: headerTextValues[0], key: "cntID", hidden: true }, { headerText: headerTextValues[1], key: "cntAKA", width: 250, template: "<a href='Home/ManageContact?cntID=${cntID}&command=edit' class='editDialog'>${cntAKA}</a>" }, { headerText: headerTextValues[2], key: "cntRelation", width: 250, template: "<a href='Home/ManageContact?cntID=${cntID}&command=edit' class='editDialog'>${cntRelation}</a>" }, ],
initialDataBindDepth: -1, primaryKey: 'cntID', width: '800', //updateURL: "Home/Update",
}); }); } });
Thank you
Regards
Sonia
Hi Maya,
Hello Sonia ,
Thank you for posting in our forum.
In general the changes are not committed to the grid if autoCommit is set to false and the data is not explicitly committed ( via the commit method :$(".selector").igGrid("commit");).
If the changes are not committed the actual data object won’t be updated with the new value.
The data would be automatically committed if something triggers a data bind (like sorting, filtering etc). In that case you can handle the dataDirty event and decide whether to commit the changes to the grid or cancel the event and manually handle the data changes.
For more information on how the dataDirty event can be handled you can refer to:
http://help.infragistics.com/Help/Doc/jQuery/2012.1/CLR4.0/html/igGrid_Updating.html#handling_datadirty_event
Let me know if you have any questions regarding this.
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
http://es.infragistics.com/support