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
460
Setting column format in the hierarchicalgrid
posted

Hi 

I am trying to set the column format in the hierarchical grid but I fail to get the format to apply and I do not get any error messages explaining what I am doing wrong. The following is a snipplet of my code.

Best Regards

Fredrik

var jsonSchema = new $.ig.DataSchema("json", {
fields: [topLevel.metaData.fields]
});

module.setDataSource = function (data, tableId, jsonSchema ) {
$("#" + tableId).igHierarchicalGrid({
width: "100%",
dataSource: data,
animationDuration: 100,
dataRendering: module.hierarchicalGridRendering,
schema:  jsonSchema ,
features: [
{
name: 'Paging',
type: "local",
showPageSizeDropDown: false,
pageSize: 80
},
{
name: "Resizing"
}
],
autoGenerateLayouts: true
});
};

 

Where the json structure looks something like this:

topLevelMetaData { schema { fields[0] { {name: someName, type: someType}, ...,  {name: someName, type: someType}}}}

Parents
  • 29417
    Offline posted

     Hello Fredrik, 

    Thank you for posting in our forum.

    You can refer to the following article from our documentation that explains how the column and layouts have to be set:

    http://help.infragistics.com/doc/jQuery/2013.2/CLR4.0/?page=igHierarchicalGrid_Columns_and_Layouts.html

     

    What seems to be missing in your example is the childrenDataProperty for the main grid which should correspond to the property name from which the child data should be retrieved from.

     

    Also responseDataKey and searchField are used when your json data is wrapped in another object. For example:

     var adventureWorks = {

                    "Records": [{

                        "ProductID": 1,

                        "Name": "Adjustable Race",

                        "ProductNumber": "AR-5381"

                    }, {

                        "ProductID": 2,

                        "Name": "Bearing Ball",

                        "ProductNumber": "BA-8327"

                    }

                ]};

     

    In the upper example the data is wrapped in an object “Records”.

    In that case it’s necessary to set the responseDataKey and searchField in order for the grid to know form which object to get its data. Otherwise they should be empty.

     

    I’ve attached an example for your reference. Let me know if you have any questions.

     

    Best Regards,

    Maya Kirova

    Developer Support Engineer II

    Infragistics, Inc.

    http://ko.infragistics.com/support

     

    grid.zip
Reply Children