Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
igHierarchicalGrid load on demand without oData
posted

Hi there,

I am trying to implement an hierarchical grid with jQuery Load on Demand, but I want to do it without oData.

 Following http://es.infragistics.com/community/forums/p/94782/468676.aspx#468676 , I tried handling the igGrid.dataBinding event and in the event handler I set the dataSource option to a URL I constructed, as follows:

$(document).on("iggriddatabinding", function (evt, ui) {

if (!ui.owner.element.hasClass("ui-iggrid-root")) {
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);

var dataSourceUrl = "http://" + localHost + rootDir + "api/exception/ex?defName=" + parentRowData.defname;
ui.owner.options.dataSourceUrl = dataSourceUrl;
}
});

The URL points to a web api controller in the same project, which in turn calls a remote Web API.  I don't have the option of implementing IQueryable in the web api.

While debugging, I tested the resultant URL in Fiddler, which works fine, but when I execute the page, I get the following error when I expand the row:

"There was an error parsing the JSON data and applying the defined data schema: Cannot read property 'Metadata' of null"

Any help would be greatly appreciated, I need this hierarchical grid to work ASAP.

Parents
No Data
Reply
  • 2355
    Offline posted

    Hi, 

    Thank you for contacting Infragistics. By the information provided I assume that the response of the request to the WebAPI is empty or not correct. Could you send me the response that you receive? Also if you could provide sample application that reproduces the issue will increase the process of finding a solution greatly. 

    Kind Regards,

    Petko Zhekov

    Software Developer

    Infragistics, Inc.

Children