Skip to content

Update multiselect.md valuePrimitive example #8325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions docs/api/javascript/ui/multiselect.md
Original file line number Diff line number Diff line change
Expand Up @@ -1392,25 +1392,37 @@ Specifies the [value binding](/framework/mvvm/bindings/value) behavior for the w

#### Example - specify that the View-Model field should be updated with the selected item value

<select id="multiselect" multiple="multiple" data-bind="value: selectedProductId, source: products"></select>
<div id="container">
<select id="multiselect" multiple="multiple"
data-bind="value: selectedProductId, source: products"></select>

<script>
<div>
<h4>Selected Product IDs:</h4>
<div data-bind="text: selectedProductIdText"></div>
</div>
</div>

<script>
$("#multiselect").kendoMultiSelect({
valuePrimitive: true,
dataTextField: "name",
dataValueField: "id"
});

var viewModel = kendo.observable({
selectedProductId: [],
selectedProductIdText: function () {
return this.get("selectedProductId").join(", ");
},
products: [
{ id: 1, name: "Coffee" },
{ id: 2, name: "Tea" },
{ id: 3, name: "Juice" }
]
});

kendo.bind($("#multiselect"), viewModel);
</script>
kendo.bind($("#container"), viewModel);
</script>

### virtual `Boolean|Object`*(default: false)*

Expand Down