Trying to port an older extjs grid over to jquery igGrid using ajax local webservice call and returning xml. Goal is to eventually get the paging to work but for now I"m having trouble getting it to display my return. I think the xml looks fine in the response but I get this error via Chrome debugger:
Uncaught Error: There was an error parsing the XML data and applying the defined data schema: Object #<Document> has no method 'iterateNext' infragistics.js:51
I have
contentType:
'text/xml; charset=utf-8', dataType: 'xml' when the response is returned I have var obj = msg and then I recreate the grid with dataSourceType: 'xml' and dataSource: obj
Please help I really want to get this to work. I refuse to return json. IMHO its a pain in the *** to get it to parse correctly especially between chrome and ie. been there done that. This is all from a grid that was working fine in extjs so I think my xml and request/response ajax pattern should be OK!
I also get a similar error (Microsoft JScript runtime error: The remote request to fetch data has failed: (parsererror) There was an error parsing the JSON data and applying the defined data schema: Unable to get value of the property 'length': object is null or undefined), but with a different scenario. I’m using what you call the “MVC” way of binding the datagrid. My DataSourceUrl is a controller action that is returning a JSON result (a queryable list of AgreementTableRow, schema defined by the columns). My controller action is returning the desired result set, but the error seems to occur when being bound to the grid...any suggestions?
Hi lwolhar,
Thank you for your reply. Glad that the issue has been resolved.
Please do not hesitate to contact me if you have any questions regarding this matter.
Ah thank you very much Petar! I can see my data now.
added the ds.data() as the dataSource (this got rid of the error)
and also really needed to move the ds.databind() to before the grid rebuilt and then the data shows up.
Onto Paging and row selection now!
I appreciate your help.
Hello lwolhar,Thank you for you reply.I have examined this scenario and the cause for such an exception may be that the dataSource for the igGrid needs to be specified through the ds.data() function as the ds object is in this case the igDataSource itself. Note that in this scenario the dataSourceType for the igGriddoes not need to be specified as the data in the igDataSource is already converted to JSON.Below is some javascript illustrating how a grid may be bound in such a scenario (where ds is the igDataSource object):
Please let me know if this helps.
OK I defined my schema and I get a slightly different error but I wonder if there may be a bug. Here is the error I now receive: Uncaught Error: There was an error parsing the XML data and applying the defined data schema: Object #<Document> has no method 'iterateNext' infragistics.js:51
So my schema (a subset) is defined as so. I think what I have looks correct but let me know if you see something my data is more nodes than attributes of nodes.
var xmlSchema = new $.ig.DataSchema("xml", {
fields: [ { name: "aname", xpath: "act_name"}, {name: "pop",xpath"population"}],
searchField: "//data" });
The xml is constructed of nodes (not attributes of nodes).
<response>
<totalCount>19</totalCount>
<data>
<act_name>Tire City Account</act_name>
<population>5000</population>
</data>