This is a migrated thread and some comments may be shown as answers.

Where does the datasource of the destination listbox live?

2 Answers 380 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Mick
Top achievements
Rank 1
Mick asked on 24 May 2017, 03:42 PM

So I may be missing something quite obvious, but I've been stuck on this for the past day.

I've got a source listbox with a destination listbox to the right. Let's say the datasource of the source listbox is optionList, and the datasource of the destination listbox is selectionlist. It appears selectionList does not get populated with the items moved from the source to destination listbox.

Am I looking in the wrong place to find the output list? It seems this is a new(er) feature so documentation and forum posts are light. I appreciate any help, thanks!

2 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 26 May 2017, 11:39 AM
Hello Mick,

When the two ListBox widgets are connected, moving the items will result in removing the item from the first dataSource and adding it to the second one.

I made an example demonstrating this. When the button has clicked the data for the second ListBox can be observed in the console:

http://dojo.telerik.com/ihIte

As for the light posts, this is indeed a new widget which was introduced in the beginning of May this year, and most of the resources are only in the documentation and the demos, but we try to improve them with more scenarios.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
0
Mick
Top achievements
Rank 1
answered on 31 May 2017, 09:24 PM

Ah, awesome! Thanks.

It seems I was missing the step of assigning the data to the list in scope. I tried setting dataSource in the options for the 'selected' list, but I guess that doesn't connect with the selected data items? I now have a function to return the list instead of trying to read the dataSource.

    $scope.getPlantList = function getPlantList () {
        let listBox = $("#selected").data('kendoListBox');
        if (listBox) {
            return listBox.dataSource.data();
        } else {
            return false;
}

 

Oh well, it's working now and I'm liking the new widget. Thanks again!

Tags
ListBox
Asked by
Mick
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Mick
Top achievements
Rank 1
Share this question
or