We have been using Kendo UI Grid integrated with angularJS, using angular-kendo.js JavaScript library for the integration.
The new release of Kendo UI, which integrates the angular directives with the core Kendo functionality, has broken our application.
The grid.Destroy() function removes all columns except the "Quantities" columns, which are array based JavaScript objects.
The "Quantities" columns which are left in the grid following grid.Destroy() are dynamically constructed at run time, since we do not know the number of "Quantities" columns until data is returned from the server.
All grid data is displayed correctly on initial page load.
Below is code being used.
// one row of Jason sent from the server to populate the dataSource:
{"col1":[1,3],"col2":"12345","col3":[1,3],"col4":"Value","col5":1,"col6":"99999","col7":"324567-29","col8":"22222","col9":"true","Quantities":[{"qty":"3", "modified":"false","status":"A"},{"qty":"3", "modified":"false","status":""},{"qty":"3", "modified":"false","status":""},{"qty":"3","modified":"false", "status":""}]}
// Code to dynamically create Quantities columns
// dynamically create column headers for partQuantities
// loop through lomPartNumberColumnHears to get column titles
var abcQtyColumnHeader = function (field, title, width, attributes, template) {
this.field = field;
this.title = title;
this.width = width;
this.attributes = attributes;
this.template = template;
}
// get length of ABCColumnHeaders to establish loop for creating partQuantity
column headers
var abcLength = ourData.ABCColumnHeaders.length;
// loop to push partQuantities column header objects onto colDefinitionData
array
for (var i = 0; i < ourData.ABCColumnHeaders.length; i++) {
var title = ourData.ABCColumnHeaders[i];
var QuantityField = "Quantities[" + i + "].qty";
var width = "46px";
var template = "<div value=#if(Quantities[" + i + "].status ==='A'){# #='add'# #} else if(Quantities[" + i + "].status === 'D'){##='delete'# #} else if(Quantities[" + i +"].status === 'C'){##='change'# #}#>#= Quantities[" + i + "].qty #</div>";
var attributes = { style: "text-align:center" };
var abcQuantityColumnHeader = new abcQtyColumnHeader(partQuantityField, title,
width, attributes, template);
colDefinitionData.push(abcQuantityColumnHeader);
}
The new release of Kendo UI, which integrates the angular directives with the core Kendo functionality, has broken our application.
The grid.Destroy() function removes all columns except the "Quantities" columns, which are array based JavaScript objects.
The "Quantities" columns which are left in the grid following grid.Destroy() are dynamically constructed at run time, since we do not know the number of "Quantities" columns until data is returned from the server.
All grid data is displayed correctly on initial page load.
Below is code being used.
// one row of Jason sent from the server to populate the dataSource:
{"col1":[1,3],"col2":"12345","col3":[1,3],"col4":"Value","col5":1,"col6":"99999","col7":"324567-29","col8":"22222","col9":"true","Quantities":[{"qty":"3", "modified":"false","status":"A"},{"qty":"3", "modified":"false","status":""},{"qty":"3", "modified":"false","status":""},{"qty":"3","modified":"false", "status":""}]}
// Code to dynamically create Quantities columns
// dynamically create column headers for partQuantities
// loop through lomPartNumberColumnHears to get column titles
var abcQtyColumnHeader = function (field, title, width, attributes, template) {
this.field = field;
this.title = title;
this.width = width;
this.attributes = attributes;
this.template = template;
}
// get length of ABCColumnHeaders to establish loop for creating partQuantity
column headers
var abcLength = ourData.ABCColumnHeaders.length;
// loop to push partQuantities column header objects onto colDefinitionData
array
for (var i = 0; i < ourData.ABCColumnHeaders.length; i++) {
var title = ourData.ABCColumnHeaders[i];
var QuantityField = "Quantities[" + i + "].qty";
var width = "46px";
var template = "<div value=#if(Quantities[" + i + "].status ==='A'){# #='add'# #} else if(Quantities[" + i + "].status === 'D'){##='delete'# #} else if(Quantities[" + i +"].status === 'C'){##='change'# #}#>#= Quantities[" + i + "].qty #</div>";
var attributes = { style: "text-align:center" };
var abcQuantityColumnHeader = new abcQtyColumnHeader(partQuantityField, title,
width, attributes, template);
colDefinitionData.push(abcQuantityColumnHeader);
}