I have a grid that I need to be able to drill into the children. Previously I would reload the page with the child id but that would prevent the user from seeing the parent items. For example:
Initial View:
Parent Parent Parent Parent
On Parent Click - Refresh the View to Show the Children: Parent Child Child Child Parent Parent Parent
Here's the error I am receiving:
Microsoft JScript runtime error: 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
I've tried the following methods in a jQuery .ajax post success event:
${selector}.igGrid('dataSource', items);
${selector}.igGrid('dataSourceObject', items);
${selector}.igGrid({ dataSource : items });
${selector}.igGrid({ dataSourceObject : items });
And they all result in the same error. Either it happens the data source is set, or when I try to data bind. I've inspected the result coming back and it looks perfect.
The initial datasource is set via the model.
@(Html.Infragistics().Grid<ViewModel>()....DataSource(Model.Items).DataBind().Render())
The client does not wish to use the hierarchical grid. Our client does not want to see multiple headers. The children and parent share the same data model.
Using CDN version 2059.
Thanks!
${selector}.igGrid('option', 'dataSource', items);${selector}.igGrid('dataBind');
I was missing the 'option'.Everything works as intended.
This solution is giving me a stack overflow in IE8. Therefore I cannot accept this as an answer. I'd prefer to use the DataSource or DataSourceObject to set the value like I do in all of the other pages I use.
I got it working by switching the DataSource instantiation from .DataSource(Model.Items) to .DataSourceUrl(Url.Action("GetItems")) then by switching the ajax call to pass in the parameters using the data source object.
Seems like the former should have worked.