This is a migrated thread and some comments may be shown as answers.
transferFrom on doubleclick
4 Answers 14 Views
This is a migrated thread and some comments may be shown as answers.
Niranjan
Top achievements
Rank 1
Niranjan asked on 08 Jan 2018, 08:01 AM

Hello,

I have written the code to transfer an element in the source listbox by double clicking on it as follows

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

this works fine.
But, I am unable to achieve the reverse scenario.

viz; I can't transfer an element in the destination listbox back to the source listbox by double clicking on it.
Any help would be appreciated!

Thanks, 
Niranjan

4 Answers, 1 is accepted

Sort by
0
Niranjan
Top achievements
Rank 1
answered on 08 Jan 2018, 08:43 AM

Referring to the following dojo

 

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

 

Element from listboxA is moved to listboxB.

I want an element from listboxB to listboxA on double clicking the item.

0
Niranjan
Top achievements
Rank 1
answered on 09 Jan 2018, 05:33 AM

Hello,

I think i found a way out of this by myself

 

ListBoxB.wrapper.find(".k-list").on("dblclick", ".k-item", function (e) {
        ListBoxA._executeCommand("transferFrom");
    });

 

This is working for me. Anyhow i would really appreciate if you could review whether I have implemented it in the best way possible or not.

Thanks & Regards,
Niranjan

0
Preslav
Telerik team
answered on 09 Jan 2018, 11:25 AM
Hi Niranjan,

I checked the provided solution and it looks excellent. Having said that, I do not have any comments about the code.

On a side note, I would like to ask for your permission for using the provided code to create a public Knowledge base article. This article might help someone from the Kendo UI community if he or she encounters a similar problem.

I look forward to your reply.


Regards,
Preslav
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.
0
Niranjan
Top achievements
Rank 1
answered on 09 Jan 2018, 12:55 PM
Hi Preslav,

I would be glad to make any contributions to the public knowledge base. I hope this piece of code proves useful to fellow developers.
As always, I appreciate the prompt and speedy support you guys at Progress Telerik provide.

Thanks & Regards,
Niranjan
Asked by
Niranjan
Top achievements
Rank 1
Answers by
Niranjan
Top achievements
Rank 1
Preslav
Telerik team
Share this question
or