They have not given any method that can help but you can try out below code that works great.
Here first time igGrid load on DOM and second onwards load after calling igGridUpdate(), that wroks really great.
I have used data from my application URL which gives me json data you pass directly data source.
$(document).ready(function() {
var data = "/orders/open_orders.json";
igGridLoading(data);
});
function igGridUpdate()
{
$.ajax( {
type : 'GET',
url : '/orders/open_orders.json',
dataType : 'json',
success : function(data) {
igGridLoading (data);
},
error: function(XMLHttpRequest, testStatus, errorThrown) {
alert('Error!');
}
});
}
function igGridLoading(data)
{
$("#open_order_list").igGrid({
columns: [
{ headerText: "Order ID", key: "id", dataType: "string", hidden:true },
{ headerText: "Order no", key: "order_number", dataType: "number" },
{ headerText: "Customer name", key: "customer_name", dataType: "string", align: "center" },
{ headerText: "Reseller name", key: "reseller_name", dataType: "string" },
{ headerText: "Created date", key: "created_at", dataType: "date" },
{ headerText: "Time", key: "created_time", dataType: "string" },
{ headerText: "Updated date", key: "updated_at", dataType: "date" },
{ headerText: "Time", key: "updated_time", dataType: "string" },
{ headerText: "Order status", key: "order_status_name", dataType: "string" },
{ headerText: "Updated by", key: "updated_by", dataType: "string" }
],
dataSourceType: 'json',
dataSourceUrl: "/orders/open_orders_grid",
dataSource: data,
primaryKey: "id",
autoGenerateColumns: false,
width: "900px",
responseDataKey: "results",
features: [
{
name: "Tooltips",
style: Modernizr.touch ? "popover" : "tooltip",
visibility: "always"
},
{
name: 'Paging',
type: "local",
pageSize: 10
},
{
name: "Filtering",
type: "local",
mode: "advanced",
filterDialogContainment: "window"
},
{
name: "Resizing"
},
{
name: "Selection",
mode: 'row',
multipleSelection: true
},
{
name: "Sorting",
type: "local",
mode: "multi",
sortingDialogContainment: "window"
},
{
name: "Hiding"
},
{
name: "ColumnMoving",
columnMovingDialogContainment: "window"
}
]
});
}
Let me know If you need any help