Skip to content

Replies

0
Maya Kirova
Maya Kirova answered on Jun 22, 2016 8:03 AM

Hello KOK MANG TANG ,

 If you’re using KnockoutJS then I recommend that you also take advantage of our knockout js extensions , which support KnockoutJS bindings with the igHierarchicalGrid widget.

You can refer to the following sample from our samples browser, which demonstrates the configuration for achieving two-way data-binding between your model and the grid:


http://www.igniteui.com/hierarchical-grid/bind-hgrid-with-ko

 

Note that if anything in the model changes then the grid will automatically reflect the changes.

 

Let me know if you have any questions.

 

Best Regards,

Maya Kirova

Infragistics, Inc.

http://es.infragistics.com/support

 

 

0
Maya Kirova
Maya Kirova answered on May 27, 2016 11:49 AM

Hello Brian, 

Thank you for posting in our forum.

 By default there’s no  option in the grid that can re-define the generated url params.

You could however use the urlParamsEncoded setting on the igDataSource:


http://www.igniteui.com/help/api/2016.1/ig.datasource#options:settings.urlParamsEncoded

 And in it change the sortingParams’s $orderby value when a column is grouped.

For example:

var myUrlParamsEncoded = function (item, params) {

                params.sortingParams.$orderby = "CustomName asc";

}

 

Which would let you change the orderBy query string before the request is send to the server.

 

Let me know if that would solve your issue.

               

Best Regards,

Maya Kirova

Infragistics, Inc.

http://es.infragistics.com/support

 

0
Maya Kirova
Maya Kirova answered on Dec 23, 2015 10:33 AM

Hello Roman, 

Thank you for posting in our forum.

Could you specify which grid you’re referring to? The Asp.net WebDataGrid, the IgniteUi igGrid or some other grid?

I’m looking forward to your reply. 

Best Regards,

Maya Kirova

Infragistics, Inc.

http://es.infragistics.com/support

 

 

0
Maya Kirova
Maya Kirova answered on Sep 18, 2015 8:38 AM

Hello Sunilkumar, 

Those are the rows associated with the additional records added  for the Subtraction field:

  data.push({ "group": "Subtraction(A-B)", "id": "1153", "value": sumGroupA[0]['1153'] – sumGroupB[0]['1153'] });

   data.push({ "group": "Subtraction(A-B)", "id": "1154", "value": sumGroupA[0]['1154'] – sumGroupB[0]['1154'] }); 

As you can see they don’t have a “Date” field in them. Since we use them just to calculate the values for the additional Subtraction field we can skip rendering them in the Pivot.

You can do that by checking in the memberProvider function for the “id” field whether the record that will be rendered has a Date value or not. If it doesn’t then simply don’t return a value for them and the pivot won’t render them. For example:

 {

                                    caption: "id",

                                    name: "id",

                                    levels: [

                                        { name: "id", levelCaption: "id", memberProvider: function (item) {

                                           if(item.Date !== undefined)

                                             {

                                              return item.id;

                                              }

                                   } }

                                    ]

                                }

 

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

 

 

Best Regards,

Maya Kirova

Infragistics, Inc.

http://es.infragistics.com/support

 

 

0
Maya Kirova
Maya Kirova answered on Sep 16, 2015 8:16 AM

Hello Sunilkumar,

 

So the id’s should be presented in the rows and the groups should be presented in the columns.

In that case you can defined both in separate hierarchies in the data source for example:

  hierarchies: [

                                {

                                    caption: "group",

                                    name: "group",

                                    levels: [

                                        { name: "group", levelCaption: "group", memberProvider: function (item) { return item.group; } }                                                                                                                                                               

                                    ]

                                },

                                                                                                                                {

                                    caption: "id",

                                    name: "id",

                                    levels: [

                                { name: "id", levelCaption: "id", memberProvider: function (item) { return item.id; } }

                                    ]

                                }

                            ]

 

And define the rows to use the “id” hierarchy and the columns to use the “group” hierarchy:

  rows: "[group].[id]",

  columns: "[group].[group]"

 

 

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

 

 

Best Regards,

Maya Kirova

Infragistics, Inc.

http://es.infragistics.com/support

 

 

0
Maya Kirova
Maya Kirova answered on Sep 15, 2015 9:15 AM

Hello Sunilkumar, 

The OlapFlatDataSource can operate only on a single data object as it allows only a single data source to be set. 

I suggest you merge those jsons in a single json and add an additional object that will define the group each record belongs to. For example:

 

var balancesheet = [

//groupA

    { "group": "A", "id": "1153", "value": 12.814 },

    { "group": "A", "id": "1153", "value": 3.565 },

    { "group": "A", "id": "1154", "value": 11.66 },

    { "group": "A" ,"id": "1154", "value": 8.512 },

//groupB

   { "group": "B", "id": "1153", "value": 18.137 },

   { "group": "B", "id": "1153", "value": 16.056 },

   { "group": "B", "id": "1154", "value": 6.999 },

   { "group": "B" ,"id": "1154", "value": 5.887 }               

]; 

Then you can add an additional level which will group the values based on the “group” object. For example:

                    dimensions: [

                        {

                            caption: "id",

                            name: "id",

                            hierarchies: [

                                {

                                    caption: "group",

                                    name: "group",

                                    levels: [

                                        { name: "group", levelCaption: "group", memberProvider: function (item) { return item.group;} },

                                       { name: "id", levelCaption: "id", memberProvider: function (item) { return item.id; } }

                                    ]

                                }

                            ]

                        }                                                                                               

                    ]

In that way under group A and B you’ll have separately the sum of the values under 1153 and 1154.

To add an additional Subtraction column you can add two additional records to the data source for the two separate substractions (1553 (A-B) and 1553(A-B)). For example:

                data.push({ "group":"Subtraction for 1153 (A-B)", "id": "Subtraction", "value": sumGroupA[0]['1153'] – sumGroupB[0]['1153']  });

                data.push({ "group":"Subtraction for 1154 (A-B)", "id": "Subtraction", "value": sumGroupA[0]['1154']  – sumGroupB[0]['1154']  });

 

I’ve attached a sample for your reference, let me know if you have any question.

 

Best Regards,

Maya Kirova

Infragistics, Inc.

http://es.infragistics.com/support

 

 

0
Maya Kirova
Maya Kirova answered on Sep 11, 2015 8:47 AM

Hello Sunilkumar,

 Let me know if you encounter any issues or have any additional questions or concerns.

 

Best Regards,

Maya Kirova

Infragistics, Inc.

http://es.infragistics.com/support