jQuery UI Widgets › Forums › Grid › Grid – No Data Display
This topic contains 8 replies, has 3 voices, and was last updated by Dimitar 9 years, 7 months ago.
-
AuthorGrid – No Data Display Posts
-
Hi Peter,
I know that this is very common problem but unfortunately I could not find the reason from recent topics
Although there is json data, it says ‘No Data To Display’ at grid.
My code is very simple. It is below. It is sure there is json data,var url = ‘/msa/stores2?cmd=json_product_rec’;
// prepare the data
var sourceGrid = {
datatype: “json”,
datafields: [
{ name: ‘RecordID’ },
{ name: ‘RecordDate’},
{ name: ‘Branch’ }
],
root: “Products”,
record: “Product”,
id: ‘RecordID’,
url: url,
beforeprocessing: function(data) {
sourceGrid.totalrecords = data.total;
}
};dataAdapterGrid = new $.jqx.dataAdapter(sourceGrid, {
downloadComplete: function (data, status, xhr) { },
loadComplete: function (data) { alert(“data”.data);},
loadError: function (xhr, status, error) { alert(“error”.error); },
});$(“#gridpricerecords”).jqxGrid( {
width: 200,
source: dataAdapterGrid,
autoheight: true,columns: [
{ text: ‘RecordDate’, datafield: ‘RecordDate’ },
{ text: ‘Branch’, width: 120, height: 130, datafield: ‘Branch’ }
]
});Hi Peter,
I am also sending json demo data.
I can see that it reaches to grid because when I alerted (data.total at beforeprocessing function) number of record I see ‘5’ at popup{“success”:true,”prd_rec”:[{“B.Branch”:”Ankara”,”R.RecordDate”:”2014-04-22″,”R.RecordID”:”308″},{“B.Branch”:”Ankara”,”R.RecordDate”:”2014-04-22″,”R.RecordID”:”309″},{“B.Branch”:”Ankara”,”R.RecordDate”:”2014-04-22″,”R.RecordID”:”310″},{“B.Branch”:”Ankara”,”R.RecordDate”:”2014-04-22″,”R.RecordID”:”311″},{“B.Branch”:”Ankara”,”R.RecordDate”:”2014-04-22″,”R.RecordID”:”312″}],”total”:5}
Hi Peter,
I found problem.
I removed following ones and it workedroot: “Products”,
record: “Product”,Hello digikv,
These demos work fine on our side. Did you install the version of the Northwind database included in the
phpdemos
folder? What server do you run the examples on?Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi digikv,
Are there any errors thrown in your browser console when running the examples?
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi digikv,
If you cannot run the examples, you can try recreating them by following the tutorials in the PHP Integration section of the Documentation, such as Bind jQuery Grid to MySql Database using PHP. You can also use the online PHP demos as a reference.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.