Hello,
We have a grid that row mode filter is enabled and data source model has a field that has type as object. After we used the 2017 r2 release this grid is not loading correctly. Below you can find a sample code block that demonstrates this issue on dojo.
function
renderStores(stores) {
if
(
typeof
stores !=
"undefined"
&& stores !=
null
) {
var
template =
"<ol>"
;
for
(
var
i = 0; i < stores.length; i++)
template = template +
"<li>"
+ stores[i] +
"</li>"
;
return
template +
"</ol>"
;
}
else
{
return
""
;
}
}
$(document).ready(
function
() {
$(
"#grid"
).kendoGrid({
dataSource: {
data: products,
schema: {
model: {
fields: {
ProductName: {
type:
"string"
},
UnitPrice: {
type:
"number"
},
UnitsInStock: {
type:
"number"
},
Discontinued: {
type:
"boolean"
},
Stores: {
type:
"object"
}
}
}
},
pageSize: 20
},
height: 550,
scrollable:
true
,
sortable:
true
,
filterable: {
mode:
"row"
},
pageable: {
input:
true
,
numeric:
false
},
columns: [
"ProductName"
,
{
field:
"UnitPrice"
,
title:
"Unit Price"
,
format:
"{0:c}"
},
{
field:
"UnitsInStock"
,
title:
"Units In Stock"
},
{
field:
"Discontinued"
},
{
field:
"Stores"
,
template:
"#=renderStores(Stores)#"
,
filterable: {
cell: {
template:
function
(args) {
console.log(args.element);
}
}
}
}
]
});
});
var
products = [{
ProductID: 1,
ProductName:
"Chai"
,
SupplierID: 1,
CategoryID: 1,
QuantityPerUnit:
"10 boxes x 20 bags"
,
UnitPrice: 18.0000,
UnitsInStock: 39,
UnitsOnOrder: 0,
ReorderLevel: 10,
Discontinued:
false
,
Category: {
CategoryID: 1,
CategoryName:
"Beverages"
,
Description:
"Soft drinks, coffees, teas, beers, and ales"
},
Stores: [
"Store 1"
,
"Store 2"
,
"Store 3"
]
}, {
ProductID: 2,
ProductName:
"Chang"
,
SupplierID: 1,
CategoryID: 1,
QuantityPerUnit:
"24 - 12 oz bottles"
,
UnitPrice: 19.0000,
UnitsInStock: 17,
UnitsOnOrder: 40,
ReorderLevel: 25,
Discontinued:
false
,
Category: {
CategoryID: 1,
CategoryName:
"Beverages"
,
Description:
"Soft drinks, coffees, teas, beers, and ales"
},
Stores: [
"Store 1"
,
"Store 2"
,
"Store 3"
]
}, {
ProductID: 3,
ProductName:
"Aniseed Syrup"
,
SupplierID: 1,
CategoryID: 2,
QuantityPerUnit:
"12 - 550 ml bottles"
,
UnitPrice: 10.0000,
UnitsInStock: 13,
UnitsOnOrder: 70,
ReorderLevel: 25,
Discontinued:
false
,
Category: {
CategoryID: 2,
CategoryName:
"Condiments"
,
Description:
"Sweet and savory sauces, relishes, spreads, and seasonings"
},
Stores: [
"Store 1"
,
"Store 2"
,
"Store 3"
]
}];
What is the correct way to fix this issue?
Regards.