jQWidgets Forums
jQuery UI Widgets › Forums › Grid › load server data not getting invoked
Tagged: datagrid component, jqwidgets datagrid
This topic contains 2 replies, has 2 voices, and was last updated by smitha302 11 years, 4 months ago.
-
Author
-
Hi ,
I have made use of virtual mode for server side paging and I want to manually handle the ajax calls through the jqxDataAdapter . For making ajax calls, I am using a tag from JSF framework . From the load server data, I want to call a function to this jsf tag from where the ajax call will be made . I have declared another method to be called on success . My problem is the function declared in the loadServerData is not getting invoked for populating data , so am getting a blank grid . Please let me know if I am doing anything wrong . Following is my code snippet.var source = { datatype: “json”,
data:fetchPostData(this._gridWrapperId),
datafields:this._dataFields,
id: ‘PrimaryKey’,
totalrecords : this._totalRecords
};
var settings = { loadServerData: function(postdata, source, callback)
{
// function call from where ajax request will be made
getReviewGridDataObj(postdata, source, callback);
}};
var dataAdapter = new $.jqx.dataAdapter(source,settings);$(“#” + this._gridId).jqxGrid({source : dataAdapter,
width : gridWt,
theme: theme,
pageable : true,
autoheight : true,
sortable : true,
altrows : true,
enabletooltips : true,
editable : true,
columns: this._colMetaData,
columnsresize: true,
pagesize:this._pgSize,
virtualmode: true,
rendergridrows: function(obj){
return obj.data;
}
});
// function to be called on ajax call success
function createGridWithDataObj(data,gridId,source,callBack){
{
var records = JSON.parse(data);
dataAdapter.loadjson(null, records, source);
callback({records: dataAdapter.records, totalrecords: source.totalrecords});
};}
Hi smitha302,
1. Using internal API is wrong and we do not suggest you doing it. “loadjson” is an Internal method and should not be used.
2. dataAdapter.records is Empty. The property is populated by the result of the callback which you call.Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/I will remove the loadjson method call . But my problem is the function defined in the loadServerData is not getting invoked . Can you please let me know why ?
-
AuthorPosts
You must be logged in to reply to this topic.