Hi All,I have an requirement that i need to load data on demand for igHierarchicalGrid. I am not able to give configuration of datasource using either ODATA or REST settings. What i need is, when user clicks on expand button, then there should be one request made to my server which returns data only for that subchild.
The major issue I am facing is not able to give datasource or dataUrl from which, data will be loaded on the fly. Whatever examples i am getting is for ASP.NET MVC, which is of no help to me. I tried setting the dataSource in ColumnLayout as path to my request, but I am getting error as: Uncaught TypeError: Cannot read property '__deferred' of undefinedAnd also, i will need that while querying server, how can I send data or parameters in the request, the parameter should be set from the entries of the parent row which is getting expanded, NOT NECESSARY THE PRIMARY KEYI tried the approach at http://es.infragistics.com/community/forums/t/79652.aspx, but failedAny sort of help will be appreciatedRegards,
Sorry to revive an old thread, but this approach seems to be what I'm looking for. I am getting the following error when I try to set the .dataSource in the last line to a web API URL (which does work correctly when requested in Fiddler):
"There was an error parsing the JSON data and applying the defined data schema: Cannot read property 'Metadata' of null"
Can anyone help me with what I am doing wrong?
Hello Vivek Vardhan,
I'm glad that you find this information helpful.
Please let me know if you need further assistance with this matter.
Best regards,Martin Pavlov
The ui.owner.element.parents("tr[data-container='true']").prev() will return you all the parent rows up in the hierarchy. And the ui.owner.element.parents("table.ui-iggrid-table") will return you all the parent igGrid instances up in the hierarchy. You just need to iterate over them and extract the required information.
Hope this helps,Martin PavlovInfragistics, Inc.
Hi,Thanks for your help. one last question in this context is:
var parentRowId = ui.owner.element.parents("tr[data-container='true']").prev().data("id"),
parentGrid = ui.owner.element.parents("table.ui-iggrid-table").data("igGrid"),
parentRowData = parentGrid.findRecordByKey(parentRowId);Above statements are helping me in getting the parent row data, but suppose there are multiple levels of grid in hierarchy. How can I get the data of all the ancestors?
Hello Vardhan, Vivek,
For the "POST" problem what I can suggest is that you use $.ajaxPrefilter. Here is a sample code:
$.ajaxPrefilter(function( options, originalOptions, jqXHR ) { options.type = "POST"; });
$.ajaxPrefilter(function( options, originalOptions, jqXHR ) {
options.type = "POST";
});