This question is locked. New answers and comments are not allowed.
Brian Vallelunga
Top achievements
Rank 1
Brian Vallelunga
asked on 28 Oct 2014, 04:03 PM
Angular support is currently broken with MultiSelect.
For reference, refer to the current official demo at: http://demos.telerik.com/kendo-ui/multiselect/angular
The pre-selected items are not shown on load and when a new item is selected, the bound value is incorrect, showing the entire model.
Also, when binding directly to primitive values, such as a DataSource with just an array of strings, the kendo.angular.js file throws an error in the following function:
The problem is that "item" is a string, and doesn't have a toJSON method on it.
For reference, refer to the current official demo at: http://demos.telerik.com/kendo-ui/multiselect/angular
The pre-selected items are not shown on load and when a new item is selected, the bound value is incorrect, showing the entire model.
Also, when binding directly to primitive values, such as a DataSource with just an array of strings, the kendo.angular.js file throws an error in the following function:
defadvice(
"ui.MultiSelect"
,
"$angular_getLogicValue"
,
function
(){
return
$.map(
this
.self.dataItems(),
function
(item) {
return
item.toJSON();
});
});
The problem is that "item" is a string, and doesn't have a toJSON method on it.
6 Answers, 1 is accepted
0
Hi Brian,
For the multiselect you need to use ng-model instead, if you want to prepopulate the widget. As in this example:
http://dojo.telerik.com/oHiWA
Currently we are changing the implementation of the MultiSelect directive, as its current behavior differs from the expected one, so please stay tuned for changes
Regards,
Kiril Nikolov
Telerik
For the multiselect you need to use ng-model instead, if you want to prepopulate the widget. As in this example:
http://dojo.telerik.com/oHiWA
Currently we are changing the implementation of the MultiSelect directive, as its current behavior differs from the expected one, so please stay tuned for changes
Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Paul
Top achievements
Rank 1
answered on 04 Nov 2014, 10:37 AM
[quote]Kiril Nikolov said:Hi Brian,
For the multiselect you need to use ng-model instead, if you want to prepopulate the widget. As in this example:
http://dojo.telerik.com/oHiWA
[/quote]
Hi Kiril,
The demo you provided is broken. When using ng-model, if you pre-populate $scope.selectedIds then when the multi-select initialises, the model gets wiped. You can see it in the Dojo you linked to above. Run it without changing anything and you'll see that the paragraph displaying the value of selectedIds does not show. It will only show if you make a change to the values in the multi-select.
How can we get around this problem please?
For the multiselect you need to use ng-model instead, if you want to prepopulate the widget. As in this example:
http://dojo.telerik.com/oHiWA
[/quote]
Hi Kiril,
The demo you provided is broken. When using ng-model, if you pre-populate $scope.selectedIds then when the multi-select initialises, the model gets wiped. You can see it in the Dojo you linked to above. Run it without changing anything and you'll see that the paragraph displaying the value of selectedIds does not show. It will only show if you make a change to the values in the multi-select.
How can we get around this problem please?
0
Hello Paul,
It is an issue that has been resolved and will be released to clients with the official Q3 release scheduled for the next week. So please give us some more time and upgrade to the Q3 release next week, where the issue will be fixed.
Regards,
Kiril Nikolov
Telerik
It is an issue that has been resolved and will be released to clients with the official Q3 release scheduled for the next week. So please give us some more time and upgrade to the Q3 release next week, where the issue will be fixed.
Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Paul
Top achievements
Rank 1
answered on 12 Dec 2014, 05:15 PM
Hi Kiril, this is still broken in 2014.3.1119.
I'm having terrible problems with multiselect in Angular. The model value occasionally returns null even when items are selected. Is that a known fault?
Thanks
I'm having terrible problems with multiselect in Angular. The model value occasionally returns null even when items are selected. Is that a known fault?
Thanks
0
Hello Paul,
Can you send us a sample that we can test, in order to assist you further?
Regards,
Kiril Nikolov
Telerik
Can you send us a sample that we can test, in order to assist you further?
Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Paul
Top achievements
Rank 1
answered on 18 Dec 2014, 06:48 PM
The solution was to use k-ng-model instead of ng-model. I'd been using ng-model for compatibility with version 2014.2.1008 of Kendo UI.
Thanks
Thanks