Hi,
I have a ViewModel, which has a collection field ("Buildings") which should be sent back to the server and a field to fill select lists from ("BuildingsData"):
var model = kendo.observable({ Buildings: [], BuildingsData: [{ Id: 1, Title: "Building1" }, { Id: 2, Title: "Building2" }, { Id: 3, Title: "Building3" }]});
<div data-bind="source: Buildings" data-template="Building"></div>And a template to render a single building:
<script type="x-kendo-template" id="Building"> <select data-bind="source: parent().parent().BuildingsData, value: BuildingId" data-text-field="Title", data-value-field="Id" data-value-primitive="true"></select></script>What I'd like to achieve is that a building could be selected only once.
For example, I have 3 elements in the Buildings array; so after I select a value in the first dropdown, it should disappear from the two remaining.
When I reset the selection, the previously selected value should appear in all dropdowns again.
But I am confused what is the best way to implement such a behavior. I'd like to use shared data source (BuildingsData will never be changed) and cause as little refresh operations as possible.
Thanks.