I have a user control with 2 listboxes, and 2 buttons to move items from one listbox to the other. This moving is done using jQuery.
The jQuery script works fine when the listboxes aren't decorated with the RadFormDecorator. But when the listboxes are decorated, the items can't me moved between the 2 listboxes anymore.
This is a simplified version of my code, illustrating the issue:
Why is the jQuery script not moving the items when the RadFormDecorator is activated?
Best regards, Marja
The jQuery script works fine when the listboxes aren't decorated with the RadFormDecorator. But when the listboxes are decorated, the items can't me moved between the 2 listboxes anymore.
This is a simplified version of my code, illustrating the issue:
<%@ Page Language="vb" EnableEventValidation="false" AutoEventWireup="false" CodeBehind="TestRadFormDecorator1.aspx.vb"
Inherits="WebwareNET.TestRadFormDecorator1" ClientIDMode="Static" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
<
script
type
=
"text/javascript"
src
=
"http://code.jquery.com/jquery-1.10.2.min.js"
></
script
>
<
script
type
=
"text/javascript"
>
function wsListMoveItem(p_sSourceID, p_sTargetID) {
$('#' + p_sSourceID + ' > option:selected').each(function () {
$(this).remove().appendTo('#' + p_sTargetID);
});
}
</
script
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
/>
<
telerik:RadSkinManager
ID
=
"RadSkinManager1"
ShowChooser
=
"true"
runat
=
"server"
/>
<
telerik:RadFormDecorator
ID
=
"RadFormDecorator1"
DecoratedControls
=
"all"
runat
=
"server"
/>
<
table
>
<
tr
style
=
"vertical-align: middle;"
>
<
td
style
=
"text-align: center;"
>
Does NOT belong
<
br
/>
<
asp:ListBox
ID
=
"lstDoesNot"
Rows
=
"7"
SelectionMode
=
"Multiple"
runat
=
"server"
>
<
asp:ListItem
Text
=
"1"
></
asp:ListItem
>
<
asp:ListItem
Text
=
"2"
></
asp:ListItem
>
<
asp:ListItem
Text
=
"3"
></
asp:ListItem
>
</
asp:ListBox
>
</
td
>
<
td
style
=
"text-align: center;"
>
<
asp:Button
ID
=
"btnAdd"
runat
=
"server"
Text
=
"»"
UseSubmitBehavior
=
"false"
OnClientClick
=
"wsListMoveItem('lstDoesNot','lstDoes');return false;"
/>
<
br
/>
<
br
/>
<
asp:Button
ID
=
"btnRemove"
runat
=
"server"
Text
=
"«"
UseSubmitBehavior
=
"false"
OnClientClick
=
"wsListMoveItem('lstDoes','lstDoesNot');return false;"
/>
</
td
>
<
td
style
=
"text-align: center;"
>
Does belong
<
br
/>
<
asp:ListBox
ID
=
"lstDoes"
Rows
=
"7"
SelectionMode
=
"Multiple"
runat
=
"server"
>
<
asp:ListItem
Text
=
"a"
></
asp:ListItem
>
<
asp:ListItem
Text
=
"b"
></
asp:ListItem
>
<
asp:ListItem
Text
=
"c"
></
asp:ListItem
>
</
asp:ListBox
>
</
td
>
</
tr
>
</
table
>
</
form
>
</
body
>
</
html
>
Why is the jQuery script not moving the items when the RadFormDecorator is activated?
Best regards, Marja