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

Transfer selected checkboxes items

5 Answers 80 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Udi
Top achievements
Rank 1
Udi asked on 15 Oct 2010, 08:21 AM
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

5 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 21 Oct 2010, 09:27 AM
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
0
Udi
Top achievements
Rank 1
answered on 21 Oct 2010, 12:41 PM
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
0
Yana
Telerik team
answered on 26 Oct 2010, 03:35 PM
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
0
Luis
Top achievements
Rank 1
answered on 10 Nov 2010, 10:20 PM
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
0
Princy
Top achievements
Rank 2
answered on 11 Nov 2010, 08:52 AM
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.
Tags
ListBox
Asked by
Udi
Top achievements
Rank 1
Answers by
Yana
Telerik team
Udi
Top achievements
Rank 1
Luis
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or