I'm trying to manually transfer list items on the client side and received the script error 'f.getItem(...)' is null or not an object when the following method is called:
sender.transferItem(item, e.get_sourceListBox(), e.get_destinationListBox());
Basically, the aspx page has a source and destination listbox. The source listbox is pre-populated in the code behind with a list of approximately 10 items. The error occurs when a transfer is performed from the source to the destination listbox or from the destination to the source listbox.
The code for the JavaScript function that is called by the source listbox for the OnCLientTransferring event is as follows:
function RadListBoxColumnSource_OnClientTransferring(sender, e) | |
{ | |
// Cancel the transfer so that can validate which items can be transferred. | |
e.set_cancel(true); | |
// Manually transfer items that are not formula items. | |
var items = e.get_items(); | |
for (var i = 0; i < items.length; i++) | |
{ | |
var item = items[i]; | |
// If the tooltip information is available then the item is a formula. | |
var toolTip = item.get_toolTip(); | |
if ((toolTip == null) || (toolTip.length() == 0)) | |
{ | |
sender.transferItem(item, e.get_sourceListBox(), e.get_destinationListBox()); | |
} | |
} | |
return; | |
} |
The code snippet for the listboxes in the aspx page is as follows:
<table style="font-size: 0.7em; font-family: Verdana" width="500px"> | |
<tr> | |
<td> | |
<asp:Panel ID="PanelSource" runat="server" GroupingText="Data Columns" Width="100%"> | |
<telerik:RadListBox ID="RadListBoxColumnSource" runat="server" AllowReorder="false" AllowTransfer="true" EnableDragAndDrop="true" SelectionMode="Multiple" TransferToID="RadListBoxColumnTarget" Width="220px" Height="400px" OnClientTransferring="RadListBoxColumnSource_OnClientTransferring" > | |
<ButtonSettings ShowTransferAll="true" /> | |
</telerik:RadListBox> | |
</asp:Panel> | |
</td> | |
<td> | |
<asp:Panel ID="PanelTarget" runat="server" GroupingText="Selected Data Columns" Width="100%"> | |
<telerik:RadListBox ID="RadListBoxColumnTarget" runat="server" AllowReorder="true" EnableDragAndDrop="true" SelectionMode="Multiple" Width="220px" Height="400px" > | |
<ButtonSettings ShowReorder="true" /> | |
</telerik:RadListBox> | |
</asp:Panel> | |
</td> | |
</tr> | |
</table> |
The browser version is Internet Explorer 8.0.6001.18702 and the version of the Telerik controls are 2009.2.826.
Any help in resolving this issue is appreciated.
Thanks,
Tony