Hi
I have a tree list with a custom edit popup setup containing a multiselct box and having a couple of issues getting the data-bind working correctly.
Here is a subset of the ds_Tables - all fine
var ds_Tables = new kendo.data.DataSource({
data: [
{id:'MemberAdvertising', name:'Advertising'},
{id:'MemberCorporate', name:'Corporate'},
{id:'MemberHotel', name:'Hotel'},
{id:'MemberSpecialOffer', name:'Special Offers'}
]
})
Here is the code for the multiselect which loads and works fine
<select id="MemberType_MemberTypeTables" name="MemberType_MemberTypeTables"
data-bind="value:MemberTypeArray, source:ds_Tables"
data-value-field="id"
data-text-field="name"
data-source="ds_Tables"
data-role="multiselect" /></select>
The MemberType_MemberTypeTables variable in JSON is a comma separated string, so my Treeview edit looks like
edit: function(e) {
var MemberTypeArray = e.model.MemberType_MemberTypeTables.split(",");
e.model.MemberTypeArray = MemberTypeArray;
}
where I'm basically creating an array of tables to use as the data-bind values and assigning to a 'dummy variable' e.model.MemberTypeArray
The first time I press edit it doesn't do the data-binding showing the selected tables, but if I then press cancel and then edit again it works ok.
How can I force the edit popup to use the Array the first time ?
Thanks in advance.
Dave
I have a tree list with a custom edit popup setup containing a multiselct box and having a couple of issues getting the data-bind working correctly.
Here is a subset of the ds_Tables - all fine
var ds_Tables = new kendo.data.DataSource({
data: [
{id:'MemberAdvertising', name:'Advertising'},
{id:'MemberCorporate', name:'Corporate'},
{id:'MemberHotel', name:'Hotel'},
{id:'MemberSpecialOffer', name:'Special Offers'}
]
})
Here is the code for the multiselect which loads and works fine
<select id="MemberType_MemberTypeTables" name="MemberType_MemberTypeTables"
data-bind="value:MemberTypeArray, source:ds_Tables"
data-value-field="id"
data-text-field="name"
data-source="ds_Tables"
data-role="multiselect" /></select>
The MemberType_MemberTypeTables variable in JSON is a comma separated string, so my Treeview edit looks like
edit: function(e) {
var MemberTypeArray = e.model.MemberType_MemberTypeTables.split(",");
e.model.MemberTypeArray = MemberTypeArray;
}
where I'm basically creating an array of tables to use as the data-bind values and assigning to a 'dummy variable' e.model.MemberTypeArray
The first time I press edit it doesn't do the data-binding showing the selected tables, but if I then press cancel and then edit again it works ok.
How can I force the edit popup to use the Array the first time ?
Thanks in advance.
Dave