transferFrom on doubleclick

5 posts, 0 answers
  1. Niranjan
    Niranjan avatar
    11 posts
    Member since:
    Sep 2017

    Posted 08 Jan Link to this post

    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

  2. Niranjan
    Niranjan avatar
    11 posts
    Member since:
    Sep 2017

    Posted 08 Jan in reply to Niranjan Link to this post

    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.

  3. Niranjan
    Niranjan avatar
    11 posts
    Member since:
    Sep 2017

    Posted 08 Jan Link to this post

    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

  4. Preslav
    Admin
    Preslav avatar
    417 posts

    Posted 09 Jan Link to this post

    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.
  5. Niranjan
    Niranjan avatar
    11 posts
    Member since:
    Sep 2017

    Posted 09 Jan in reply to Preslav Link to this post

    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
Back to Top