I am using the Multiselect widget along with Kendo MVVM. The tags are stored in an object that is saved to the database, this works fine when creating things.
But when retrieving them is a different story. I can add tags again, that is also fine, but when the item loads in from the database, it won't properly show the existing tag items that belong in the multiselect. So let's say I pull up an item with two tags. . { "Id": "tags/1", "Name" : "C#" }{ "Id" : "tags/2", "Name" : "Kendo UI" } .. these are not persisted into the multi-select box.
But when retrieving them is a different story. I can add tags again, that is also fine, but when the item loads in from the database, it won't properly show the existing tag items that belong in the multiselect. So let's say I pull up an item with two tags. . { "Id": "tags/1", "Name" : "C#" }{ "Id" : "tags/2", "Name" : "Kendo UI" } .. these are not persisted into the multi-select box.
$widget = $element.kendoMultiSelect({
dataTextField: "Name",
dataValueField: "Id",
// define a custom template
dataSource: {
transport: {
read: {
dataType: "json",
url: $url
}
}
},
open: function (e) {
this.list.addClass("tag-cloud");
},
close: function (e) {
//e.preventDefault();
},
value: viewModel.get("Tags")
}).data("kendoMultiSelect");
<
div
style
=
"width: 500px;"
>
<
h2
class
=
"fg-color-blueDeep"
>Tags</
h2
>
<
div
class
=
"input-control"
data-for
=
"tags"
>
<
select
id
=
"tags"
multiple
=
"multiple"
data-placeholder
=
"Select Tags..."
class
=
"dark tag-cloud"
data-bind
=
"value: Tags"
style
=
"width: 500px;"
></
select
>
</
div
>
</
div
>