Hello,
now I would try the new IG jQuery tools, but I have a problem with the grid. I want to bind a JSON response string from a php service to the grid. But the grid does'nt show any data an add a column that I never defined in the code.
$(function () { $("#grid1").igGrid({ columns: [ { headerText: "ID", key: "id", dataType: "number" }, { headerText: "Description", key: "description", dataType: "string" }, { headerText: "Title", key: "title", dataType: "string" }, ], width: '800px', dataSource: "json_server.php" }); });
Is it possible to bind the return of "json_server.php" to dataSource?
Thanx
Markus
hey Markus,
Thanks for your feedback. Your code snippet is perfectly fine and should work out of the box. The grid uses the data source control internally, so you don't need to configure it manually by yourself, and only then passing an instance of it. Several things i can suggest, that can help you locate the issue:
1) is the json data located directly in the root of the response? If not, you'd probably need to specify a responseDataKey. if you can show me the format of your response i can give you more details on this
2) is the grid generating a request to your json_server.php, and is it returning with code 200 ? You can easily check this by checking with tools such as Firebug's Net tab.
3) do the column types match, meaning that is the ID column indeed a number, etc. ?
Thanks again,
Angel
thank you for your answer. Here is the response of "json_server.php".
{"passwords":[[{"id":1,"description":"test 1","title":"test 1"}],[{"id":2,"description":"test 2","title":"test 2"}]]}
The data are from a mysql query and via PHP jason_encode generated.
Greetz