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
50
Load-on-demand without MVC and oData
posted

Hi Infragistics,

I am currently trying to implement load on the demand for the hierarchical grid without using MVC or oData. As far as I have figured out this is doable by catching the ajax GET request and modify its query string in order to get the information you want from the client side to the server side. I am however having trouble getting information about what row has been clicked before the ajax GET event fires. Both the igchildgridcreating and rowExpanding events fire after the ajax GET event fires so I cannot get any information about what has actually been clicked in the grid. I have also tried and catch the click event on the actual class for the expand row button but without any luck.

Are there any events, html classes, or IDs I can catch any event on before the ajax GET is sent which will give me the same or similar information that one can get from the rowExpanding event?

I am using this to catch the ajax Get event.

$(document).ajaxSend(function (e, jqXHR, options) {

        if (options.url.indexOf("/Handler2.ashx") != -1) {
            options.url += '&param1=value1';
        }
});

In summary. What I need so to add a string on the format "[0321]" to the query string of the ajax GET call. Where "[0321]" represents the index of each row clicked on each level in the hierarchy of the grid;  hence [0321] represents the 1st row on level 0, 4th row on level 2, 3rd row on level 3, and 2nd row on level 4.

Best Regards

Fred

Parents
No Data
Reply
  • 50
    posted

    UPDATE:

    I managed to change the ajax url before if was sent to the server and now I am able to parse it and create the data source for each level as I wanted to do.

    I do however have problems formatting the data source for all levels but the initial grid on level_0. When I load the grid for the first time it loads level_0 without any problems. The json that does this is build up as a flat grid containing column headers and their values. However when expanding a row to level_1 and providing the grid with json structured in the same way but with data for that particular row and for level_1 I get the following error message from infragistics.lob.js

    "

    JavaScript 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: The input data doesn't match the schema, the following field couldn't be mapped: level_2

    "

    Does the grid try and parse data for level_2 even though I am only interested in load the data for level_1 for the particular row that was clicked? How can I fix this? Or do I just need to provide an empty set in the json for level_2 so that the hierarchical grid generates the + (expand row) icons for the rows in level_1. How does this json need to look in that case?

    Best Regards

    F

Children