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

Missing templates after stringify grid options

1 Answer 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Onlineprinters
Top achievements
Rank 1
Onlineprinters asked on 18 May 2015, 10:09 AM

Hello,

i've got a problem with persisting the state of a grid.

kendo.stringify($scope.grid.getOptions())

Templates of columns will only be exported if they are defined as strings, external templates or template functions, are ignored.

Is there a proper way to get this working?

 Works:

template: '#: (DeliverDateType) ? DeliverDateType.name : "" #',

Doesn't work:

template: kendo.template($("#colProductionJobValue").html()),
 
template: function (data) {
    var numbers = [];
    for (var i = 0; i < data.ProductionJob.length; i++) {
        if (typeof data.ProductionJob[i].id != 'undefined') {
            numbers.push(data.ProductionJob[i].id);
        }
    }
    return numbers.join(', ');
},

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 20 May 2015, 07:31 AM
Hello Fabian,

Generally, function references cannot be stringified. Please refer to the documentation:

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods-setOptions

Regards,
Dimo
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
Onlineprinters
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or