Hello,
how can I use the filter in a declarative notation? I am using a dropDownList the following way:
<select data-role="dropdownlist" data-text-field="Name" data-value-field="Id" data-bind="source: data, value: myId" data-source="{filter: {field:'Id', operator:'eq', value:'this.myId'}}"></select>
Within JavaScript:
var viewModel = kendo.observable({
data:[{Id:"1", Name:"a"}, {Id:"2", Name:"b"}, {Id:"3", Name:"c"}, ],
myId:2
});
kendo.bind($("#example"), viewModel);
But this does not work! How can I reference the myId parameter within the viewModel?
The filter works if I hardcode a value (e.g. if I write '2' instead of 'this.myId')
-----------------------------------
I added a short sample with 2 select widgets. The options of the second select widget are dependent on the first select widget.
But this sample does not work.
Can you tell me why?
http://jsfiddle.net/hollomey/fJH8P/18/
How can I filter the options of the 2nd select widget dependent on the selection value of the 1st one?
And how can I make the 2nd select widget to change automatically when a different selection is made in the 1st select widget?
And is it possible to code this sample with a filter on the dataSource?
-----------------------------------
In the next sample I use a change event in the 1st select widget. But the alert-box shows always the value from the previous selection, never the current one. And the close event hangs up the application...
There is also an update problem with the 2nd select widget when changing the selection multiple times...
What's wrong with this code?
http://jsfiddle.net/hollomey/fJH8P/26/
Thanks for your help
Florian
how can I use the filter in a declarative notation? I am using a dropDownList the following way:
<select data-role="dropdownlist" data-text-field="Name" data-value-field="Id" data-bind="source: data, value: myId" data-source="{filter: {field:'Id', operator:'eq', value:'this.myId'}}"></select>
Within JavaScript:
var viewModel = kendo.observable({
data:[{Id:"1", Name:"a"}, {Id:"2", Name:"b"}, {Id:"3", Name:"c"}, ],
myId:2
});
kendo.bind($("#example"), viewModel);
But this does not work! How can I reference the myId parameter within the viewModel?
The filter works if I hardcode a value (e.g. if I write '2' instead of 'this.myId')
-----------------------------------
I added a short sample with 2 select widgets. The options of the second select widget are dependent on the first select widget.
But this sample does not work.
Can you tell me why?
http://jsfiddle.net/hollomey/fJH8P/18/
How can I filter the options of the 2nd select widget dependent on the selection value of the 1st one?
And how can I make the 2nd select widget to change automatically when a different selection is made in the 1st select widget?
And is it possible to code this sample with a filter on the dataSource?
-----------------------------------
In the next sample I use a change event in the 1st select widget. But the alert-box shows always the value from the previous selection, never the current one. And the close event hangs up the application...
There is also an update problem with the 2nd select widget when changing the selection multiple times...
What's wrong with this code?
http://jsfiddle.net/hollomey/fJH8P/26/
Thanks for your help
Florian