Transfer selected checkboxes items

6 posts, 0 answers
  1. Oren
    Oren avatar
    36 posts
    Member since:
    Sep 2010

    Posted 15 Oct 2010 Link to this post

    Hello,

    I would like to transfer only selected checkboxes items that i was selected manually from the listbox.
    I need it from the client side.

    JS example will be appriciate.

    Regards,
    Oren
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 21 Oct 2010 Link to this post

    Hello Oren,

    Could you please explain in more details the needed approach? Thanks

    Regards,
    Yana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Oren
    Oren avatar
    36 posts
    Member since:
    Sep 2010

    Posted 21 Oct 2010 Link to this post

    Hello Yana,

    I'll try to explain it better.

    I have 2 listbox controls with checkboxes.
    In the source listbox i have 20 items and i would like to select only 3 items (checkboxes) and then to transfer the items to the destination listbox. 
    Need it in java script.

    Thank you,

    Oren
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 26 Oct 2010 Link to this post

    Hi Oren,

    Thank you for the explanation. I've attached a simple page to demonstrate how to achieve the needed approach, please download it and give it a try.

    Best wishes,
    Yana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Luis
    Luis avatar
    10 posts
    Member since:
    Oct 2010

    Posted 10 Nov 2010 Link to this post

    Hi,

    i try it and owrks fine when you MOVE FROM LEFT TO RIGHT, but it doesn't work if i want to MOVE FROM RIGHT TO LEFT. I m missing something?

    Best Regards
    Luis
  7. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 11 Nov 2010 Link to this post

    Hello Luis,


    The following code shows how to accomplish the needed functionality.

    ASPX:
    <telerik:RadListBox ID="RadListBox1" runat="server" AllowTransfer="true" CheckBoxes="true"
        Width="200px" TransferToID="RadListBox2"  OnClientTransferring="clientTransfering">
        <ButtonSettings TransferButtons="Common" />
        <Items>
            <telerik:RadListBoxItem Text="RadListBoxItem1" />
            <telerik:RadListBoxItem Text="RadListBoxItem2" />
            <telerik:RadListBoxItem Text="RadListBoxItem3" />
            <telerik:RadListBoxItem Text="RadListBoxItem4" />
            <telerik:RadListBoxItem Text="RadListBoxItem5" />
        </Items>
    </telerik:RadListBox>
    <telerik:RadListBox ID="RadListBox2" CheckBoxes="true" TransferToID="RadListBox1" runat="server" Width="200px">
    </telerik:RadListBox>


    Code:
    <script type="text/javascript">
        function clientTransfering(sender, args) {
            args.set_cancel(true);
            var checkedNodes = args.get_sourceListBox().get_checkedItems();
            for (var i in checkedNodes) {
                var item = checkedNodes[i];
                args.get_sourceListBox().transferToDestination(item);
            }
        }  
    </script>



    Happy coding,
    Princy.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017