Hi,
PFA sample data (RawFile.htm), javascript Code where I am binding data to Grid and formatting(javascriptForDataBind.txt) to get the layout which is similar to the attached png file(RequiredGridLayout1.png)
I am binding the data to grid after making a ajax call to fetch data from database.
Issues Encountered:
1. Parent node data is coming properly, where as when I try to click + icon getting error "0x800a139e - JavaScript runtime error: There was an error parsing the JSON data and applying the defined data schema: Unable to get property 'PrimarydisplayKey' of undefined or null reference"
2. jus to check with some dummy data I have used the data and the javascript which is updated in initializeWithDummyData.docx in the attachment. When I call this initializedummydata method is initialization section, I didn't get any error as mentioned above. But I observed that footage values are not coming properly, the first data for footage is being repeated for all the child records, screen shot attached as part of this document file itself.
3. Is there any option I can hide the collapse/expand icons?
4. when grid is displayed I want the grid to be expanded and should be able to see the child records as well.
Thanks,
Kiran
Hristo,
Thanks so much it worked for me. is there any way we can remove/hide the header for child grid? or the subgrid where we are just displaying the footages and checkbox?
Regards,
Hello Kiran,
Please find the answers to your questions below:
1) As mentioned above data was not properly defined.
2) There are some rows in the parent grid populated with the same data. What happens is that the grid cannot make a difference between them and loads the same row more than once (if there are three rows populated with the same data with id=1, id=2 and id=3, row with id=0 will be rendered three times). This is logged as a Development Issue with id of 175830.
Since the primaryKey you have set ("PrimarydisplayKey") is not unique, there is no need to set it. If it is possible for you to modify the data source you can add field that will contain a unique value and then set the primaryKey to that field.
3) Yes, you can hide the expand/collapse buttons with this:
$(".ui-iggrid-expandbutton").remove();
You can add this line right after the function that initializes the grid. Please refer to my sample for a demonstration.
4) You can have the grid expanded by setting the InitialExpandDepth property to 1 or by calling the following javascript function after the grid initialization:
However this is not a recommended approach since you have so many rows that expanding them on load will take the performance speed down. In my sample I have set the InitialExpandDepth to 1, but only to demonstrate to you how it slows down the loading of the page.
Please refer to my sample for a demonstration of the above mentioned. If you have any further questions, please do not hesitate to contact us, I will be glad to help.
Thanks for the reply.
I have added {"d": for the raw data just before binding it to the grid. Code sample for binding data to the grid is provided as part of previously attached zip folder (javascriptForDataBind.txt).
Thank you for posting in Infragistics forum !
Your sample data is not properly defined. I have put it in a .js file - please use it instead in your sample with a reference. Also use this options when initializing the grid:
dataSource: jsonData,dataSourceType: "json",responseDataKey: "d",
Then I managed to run your sample with that configuration and experienced the same behavior you did - every child was populated with the same data.
I am currently working on this to investigate what causes this issue. I will keep you posted with my findings.
Thank you for your patience and understanding.