Hi,
I'm working on MultiSelect + JSON as data source, i'm having issue to display the json result in Multiselect.
It display to me as undefined.
Below is my multiselect code
var
multiselect = $(
"#ddlSelectCostCenter"
).data(
"kendoMultiSelect"
)
var
dataSource =
new
kendo.data.DataSource({
data: [],
pageSize: 500
});
multiselect.setDataSource(dataSource);
if
(result !==
""
) {
dataSource =
new
kendo.data.DataSource({
type:
"json"
,
data: JSON.stringify(result),
pageSize: 500
});
multiselect.setDataSource(dataSource);
multiselect.dataTextField =
"Name"
;
multiselect.dataValueField =
"Value"
;
}
My Json is like below.
[{"Value":"0000","Name":"ALL"},{"Value":"0111","Name":"0111 ~ Facility Management"},{"Value":"0113","Name":"0113 ~ NP Logistics Setup"},{"Value":"1001","Name":"1001 ~ TV KL Tec President Office"},{"Value":"2001","Name":"2001 ~ North Chip Engineering"},{"Value":"2002","Name":"2002 ~ TV AM CHIP"},{"Value":"2003","Name":"2003 ~ AutoMount Metecon"},{"Value":"2004","Name":"2004 ~ HM Office"},{"Value":"2005","Name":"2005 ~ BOARD BIZ-HM Office"},{"Value":"2006","Name":"2006 ~ Sony MFC Sys"},{"Value":"2007","Name":"2007 ~ AM North Oth"},{"Value":"2009","Name":"2009 ~ TV AM Office"},{"Value":"2010","Name":"2010 ~ AM North DISC"},{"Value":"2011","Name":"2011 ~ AM North CHIP"}]
What do I missed out?
Thank