This is a migrated thread and some comments may be shown as answers.

Aggregates break when column.field is an indexed object

2 Answers 60 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Luciano
Top achievements
Rank 1
Luciano asked on 24 Mar 2014, 11:03 AM
We are binding the kendo grid widget to a dataset where columns are identified only by an index (their definitions/content are dynamic and are known only at runtime).

We use the following approach to bind columns:
for (var i = 0; i < 5; i++) {
    var entryIndex = "entries[" + i + "]";
    columns.push({
        field: entryIndex,
        title: "Column " + i
    });
}

Which is a mechanism that is used by others as well.

We just noticed that this approach breaks when aggregates(footerTemplate) are defined on such columns.

Example of such behavior (please uncomment marked code)

Is this a bug that can be fixed in kendo code? 
Is there a workaround you can suggest?

Thanks.

2 Answers, 1 is accepted

Sort by
0
Luciano
Top achievements
Rank 1
answered on 25 Mar 2014, 08:42 AM
I fixed it by modifying kendo source code. In "_footerTmpl" function I changed

scope = fieldsMap[column.field] ? extend({}, settings, { paramName: paramName + "." + column.field }) : {};
 
to

scope = fieldsMap[column.field] ? extend({}, settings, { paramName: paramName + "['" + column.field + "']" }) : {};

Now it works correctly. Would you consider adding a similar fix to your code?
0
Alexander Popov
Telerik team
answered on 26 Mar 2014, 12:37 PM
Hi Luciano,

Thank you for the suggestion. I will forward it to our development team for further evaluation and consideration. 

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Luciano
Top achievements
Rank 1
Answers by
Luciano
Top achievements
Rank 1
Alexander Popov
Telerik team
Share this question
or