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

Double click or multi-select option

7 Answers 613 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 07 Sep 2017, 09:07 AM
Is it possible to move item from one list to another just by double clicking on an item? I could not find this in the documentation and I'm not sure if it is supported. If it is not supported, would it be possible to add a checkbox before each item (via template) so that once the move button is clicked all the checked item will be moved?

7 Answers, 1 is accepted

Sort by
0
Joana
Telerik team
answered on 12 Sep 2017, 04:53 AM
Hello Eric,

You could bind the double click handler via jQuery. Here is an example how it should look like and you could modify the selectors: 

$(".k-list").on("dblclick", ".k-item", function(){
    alert("Clicked");
});

You could add checkbox to the ListBox items via template. Have a look at our demo regarding the usage of templates: https://demos.telerik.com/kendo-ui/listbox/templates.


Regards,
Joana
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 visualization (charts) and form elements.
0
Eric
Top achievements
Rank 1
answered on 12 Sep 2017, 07:08 AM

Hi Joana,

 

Thanks for your reply. How can I trigger the move event from one list box to another instead of the alert?

 

Thanks.

0
Joana
Telerik team
answered on 13 Sep 2017, 07:50 AM
Hello Eric,

I have prepared a dojo sample illustrating how to execute command in the ListBox on double click:

http://dojo.telerik.com/@jivanova/EtEzOz

You could use the _executeCommand method of the widget to transfer the items on double click.

Regards,
Joana
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 visualization (charts) and form elements.
0
Eric
Top achievements
Rank 1
answered on 13 Sep 2017, 12:58 PM
Thanks again for your reply. The example works and I managed to do it both ways, however, how can this be replicated on ASP.NET MVC?
0
Joana
Telerik team
answered on 15 Sep 2017, 12:37 PM
Hello Eric,

The same logic could be applied in ASP.NET MVC scenario. Once you have initialized the widget, you could take its reference in the client-side and the code will look like:

$("#listBox").data("kendoListBox").wrapper.find(".k-list").on("dblclick", ".k-item", function(e){
   listBoxA._executeCommand("transferTo");
});


Regards,
Joana
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 visualization (charts) and form elements.
0
Krishna
Top achievements
Rank 1
answered on 24 Oct 2017, 04:24 AM

Hello Joana,

I am facing the same problem where currently i am using Kendo UI for my MVC project in which i need to transfer the item whenever a user double clicks on the listbox. I tried using your solution but it is not working. 

 

Could you please help me..?

Thanks,

Krishna

0
Joana
Telerik team
answered on 25 Oct 2017, 02:31 PM
Hi Krishna,

Could you please share more details on the matter? What is the configuration of the ListBox widget and are there any javascript errors when using the approach suggested in this thread? It will be useful if you could send us a sample isolated project where we could examine the behavior.

Regards,
Joana
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ListBox
Asked by
Eric
Top achievements
Rank 1
Answers by
Joana
Telerik team
Eric
Top achievements
Rank 1
Krishna
Top achievements
Rank 1
Share this question
or