Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
115
igGrid, DataSource and update datasource automatically.
posted

Hi,

I am getting data using ajax and then show it on client using igGrid using following method -

$.ig.loader(function () {

var data = eval(FirstGrid.getJsonDataTable().value);
$("#grid").igGrid({
autoGenerateColumns: false,
columns: [
{headerText: "Dosage D", key: "Dosage", width: "150px", dataType: "string" },
{headerText: "Drugg", key: "Drug", width: "150px", dataType: "string"},
{headerText: "Patient Name", key: "Patient", width: "150px", dataType: "string"}
],
width: 700,
dataSource: data,
features: [
{
name: 'Updating'
}
]
});
});

My data display fine and then user update data by clicking on the grid cell. My page has also input button as follows -

<input type = "button" value ="Save" onclick ="SaveChanges()" />


function SaveChanges() {
var ds = $("#grid").igGrid("option", "dataSource");


}

on putting break point on the SaveChanges method, and getting data, i find out this is old data and not a copy of update data. Is there is way in infraguistics to get the updated data. 

I do not want to attached this whole process to url or something, I want to get json data from the server and bind it to the grid and then in the end get the updated data back. Because my page has other data and grid data is a sub-set of whole data.

Thanks,

Daljit Singh

Parents
  • 24671
    Suggested Answer
    posted

    Hi Daljit,

    you need to set autoCommit to true in order to get the data updated immediately in the data source. if you don't set it ( and false is its default value), the data source will have the old data and you can retrieve the updates by getting the transactions from the data source /grid APIs:

    http://help.infragistics.com/jQuery/2012.2/ui.iggrid => methods = > pendingTransactions

    Please refer to the following help topic for information on how to perform updates:

    http://es.infragistics.com/help/topic/88cc9763-ce79-4ed8-8da3-c34a61e5a96d

    Hope it helps. Thanks,

    Angel

Reply Children
No Data