or
angular.module("KendoDemos", [ "kendo.directives" ]) .controller("MyCtrl", function($scope){ $scope.mainGridOptions = { dataSource: { type: "odata", transport: { update: function(options){ console.log("updated"); } } }, editable: "inline", columns: [{ field: "FirstName", title: "First Name", width: "120px" },{ field: "LastName", title: "Last Name", width: "120px" },{ field: "Country", width: "120px" },{ field: "City", width: "120px" },{ command: ["edit", "destroy"], title: " ", width: "250px" }] }; })Hi,
I'm getting a strange behavior in a grid after update to the latest 2014.3.1316 version in some header elements where values of "data-field" attribute mismatched the expected value however the title and the rest of attributes are correct. As I have described it in the title this occurs when I arrange the column's configuration array for multicolumns mode but not if I use single column headers.
After a while debugging, I've found that headers are well generated and fields are synchronized before binding the view and the model. Just after returning from the bind function is when headers change incorrectly.
The grid is defined inside a template file and it is compile as follow:
<div id="product-grid4" class="product_grid_widget" data-role="grid" data-auto-bind="false" data-sortable="true" data-pageable="false" data-filterable="{ extra: false }" data-bind="source: products.dataSource" data-editable="false" data-selectable="true" data-resizable="true" data-scrollable="true" data-reorderable="false" data-columns='[{ "field" : "_SELECTED_", "type" : "integer", "filterable" : false, "title" : "", "width" : 29, "headerTemplate" : "", "template" : "<div id=\"#=Order_Code#\" class=\"grid-selection-column-box#if(_SELECTED_>-1){# #=WE.selectionColumnTemplate(Order_Code)##}#\"><div class=\"checkmark\"></div></div>", "attributes" : { "class" : "checkmark" }}, { "field" : "Series", "type" : "string", "title" : "Series", "width" : 85, "filterable" : true}, ...<th class="k-header" role="columnheader" rowspan="2" data-field="_SELECTED_" data-role="columnsorter" data-index="0"> <a class="k-link" href="#"/></th><th class="k-header k-with-icon k-filterable" role="columnheader" rowspan="2" data-field="Series" data-role="columnsorter" data-index="1" data-title="Series"> <a tabindex="-1" class="k-grid-filter" href="#"> <span class="k-icon k-filter"/> </a><a class="k-link" href="#">Series</a></th><th class="k-header k-with-icon k-filterable" role="columnheader" rowspan="2" data-field="Order_Code" data-role="columnsorter" data-index="2" data-title="Order Code"> <a tabindex="-1" class="k-grid-filter" href="#"> <span class="k-icon k-filter"/> </a><a class="k-link" href="#">Order Code</a></th><th class="k-header" role="columnheader" rowspan="2" data-field="Datasheet" data-index="3" data-title="Spec">Spec</th><th class="k-header k-with-icon k-filterable" role="columnheader" rowspan="2" data-field="Type" data-role="columnsorter" data-index="4" data-title="Type"> <a tabindex="-1" class="k-grid-filter" href="#"> <span class="k-icon k-filter"/> </a><a class="k-link" href="#">Type</a></th><th class="k-header" role="columnheader" colspan="6" data-field="" data-title="Electrical Properties" data-colspan="6">Electrical Properties</th><th class="k-header" role="columnheader" colspan="5" data-field="" data-title="Dimensions" data-colspan="5">Dimensions</th><th class="k-header" role="columnheader" colspan="3" data-field="" data-title="Temperature" data-colspan="3">Temperature</th><th class="k-header" role="columnheader" colspan="4" data-field="" data-title="Construction" data-colspan="4">Construction</th><th class="k-header" role="columnheader" rowspan="2" data-field="_SELECTED_" data-role="columnsorter" data-index="0"> <a class="k-link" href="#"/></th><th class="k-header k-with-icon k-filterable" role="columnheader" rowspan="2" data-field="Order_Code" data-role="columnsorter" data-index="1" data-title="Series"> <a tabindex="-1" class="k-grid-filter" href="#"> <span class="k-icon k-filter"/> </a><a class="k-link" href="#">Series</a></th><th class="k-header k-with-icon k-filterable" role="columnheader" rowspan="2" data-field="Type" data-role="columnsorter" data-index="2" data-title="Order Code"> <a tabindex="-1" class="k-grid-filter" href="#"> <span class="k-icon k-filter"/> </a><a class="k-link" href="#">Order Code</a></th><th class="k-header k-with-icon k-filterable" role="columnheader" rowspan="2" data-field="Temperature_Warming" data-role="columnsorter" data-index="3" data-title="Spec"> <a tabindex="-1" class="k-grid-filter" href="#"> <span class="k-icon k-filter"/> </a><a class="k-link" href="#">Spec</a></th><th class="k-header k-with-icon k-filterable" role="columnheader" rowspan="2" data-field="Rated_Current" data-role="columnsorter" data-index="4" data-title="Type"> <a tabindex="-1" class="k-grid-filter" href="#"> <span class="k-icon k-filter"/> </a><a class="k-link" href="#">Type</a></th><th class="k-header" role="columnheader" colspan="6" data-field="" data-index="5" data-title="Electrical Properties" data-colspan="6">Electrical Properties</th><th class="k-header" role="columnheader" colspan="5" data-field="" data-index="6" data-title="Dimensions" data-colspan="5">Dimensions</th><th class="k-header" role="columnheader" colspan="3" data-field="" data-index="7" data-title="Temperature" data-colspan="3">Temperature</th><th class="k-header" role="columnheader" colspan="4" data-field="" data-index="8" data-title="Construction" data-colspan="4">Construction</th>kendo.data.binders.toggleState = kendo.data.Binder.extend({ refresh: function() { var that = this; var value = that.bindings["toggleState"].get(); // get value of binding from viewmodel if (value) { // true = enable $(that.element).find(':input').removeAttr('disabled'); } else { $(that.element).find(':input').attr('disabled', 'disabled'); } }});