When I use the RADListBox with grouped items. Everything displays correctly until I perform a client side transfer from one listbox to another. The transfered items append to the bottom of the listbox and are not grouped. How can I transfer and have everything regroup client side.
<script type="text/javascript">
function onClientTransferred(sender, args) {
//alert("transfer from id:" + args.get_sourceListBox().get_id());
//alert("transfer to id:" + args.get_destinationListBox().get_id());
var fromList = args.get_sourceListBox().get_items();
var fromItem = args.get_item();
var fromItemAttributes = args.get_item().get_attributes();
var fromItemCat = fromItemAttributes.getAttribute("DataGroupField");
alert("from item cat:" + fromItemCat);
args.get_destinationListBox().trackChanges();
var toList = args.get_destinationListBox().get_items();
var toItem = args.get_destinationListBox().findItemByValue(args.get_item().get_value());
var toItemAttributes = toItem.get_attributes();
toItemAttributes.setAttribute("DataGroupField", fromItemCat);
toItem.attributes = toItemAttributes;
var index = fromList.indexOf(toItem);
toList.removeAt(index);
toList.insert(index, toItem);
alert("to item:" + toItem.get_text());
args.get_destinationListBox().commitChanges();
}
</script>
<rei:REIRadListBox ID="lstFavItems" runat="server" AllowTransfer="true" TransferToID="lstTopFavItems" EnableDragAndDrop="true" EnableEmbeddedSkins="false" DataTextField="DisplayText" DataValueField="UserFavoriteId" SelectionMode="Multiple" EnableFiltering="true" FilterBoxEmptyMessage="Type here to filter" Height="200" Width="370"
TransferMode="Move" OnTransferred="RadListBox_Transferred" AllowReorder="true" OnClientTransferred="onClientTransferred" />
<rei:REIRadListBox ID="lstTopFavItems" runat="server" Height="200" Width="370" EnableDragAndDrop="true" EnableFiltering="true" EnableEmbeddedSkins="false" FilterBoxEmptyMessage="Type here to filter"
DataTextField="DisplayText" DataValueField="UserFavoriteId" AllowReorder="true" />