Hi there, I have a grid that has been initialize at the beginning with no dataSource. What I wanted to achieve is to set / re-populate the DataSource to the grid later on.
I used the method setDataSource, but it doesn't work if the grid has initialized with the options "sortable" or "filterable". I have an example code below
Any ideas?
I used the method setDataSource, but it doesn't work if the grid has initialized with the options "sortable" or "filterable". I have an example code below
$(
"#grid"
).kendoGrid({
columns: [{
field:
"date"
,
title:
"Date"
,
filterable: {
cell: {
enabled:
true
,
showOperators:
false
,
operator:
"contains"
,
}
}
},{
field:
"invoicenumber"
,
title:
"Invoice Number"
,
filterable: {
cell: {
enabled:
true
,
showOperators:
false
,
operator:
"contains"
,
}
}
}
],
filterable: { mode:
"row"
},
sortable:{ mode:
"multiple"
, allowUnsort:
true
},
scrollable:
false
});
var
grid = $(
'#grid'
).data(
"kendoGrid"
),
dataSource =
new
kendo.data.DataSource({
data:[
{ date :
"26/09/2014"
, invoicenumber:
"dsafasd"
},
{ date :
"11/11/2011"
, invoicenumber:
"zzzzzz"
}
]
});
grid.setDataSource(dataSource) ;