좋아요. 제가 생각하고있는 것이 가능한지 알고 싶습니다. 나는 연구를 시도했지만 아무것도 찾을 수 없었습니다. 데이터를 전송할 수있는 두 개의 RadLsitBox가 있습니다. 마지막 전송을 취소 할 수있는 실행 취소 단추를 추가 할 수 있는지 알고 싶습니다.Telerik RadListBox, 코드를 통해 항목을 전송하십시오.
FYI 클라이언트는 실행 취소 버튼을 원합니다. 버튼을 누르지 않고 코드를 통해서만 항목을 전달할 수 있다고 생각하지 않지만 누군가가 듣고 싶은 방식이 있다면.
<telerik:RadListBox ID="rlbStations" runat="server" AllowTransfer="True" TransferToID="rlbAllowedStations"
Height="200px" Skin="Web20" SelectionMode="Multiple" Sort="Ascending" DataKeyField="station_id"
AutoPostBackOnTransfer="true" Width="250px" OnTransferred="rlbStations_Transferred">
<ButtonSettings ShowDelete="False" ShowReorder="False" />
</telerik:RadListBox>
<telerik:RadListBox ID="rlbAllowedStations" runat="server" Height="200px" Width="250px"
Skin="Web20">
</telerik:RadListBox>
편집 : 추가 자바 스크립트
var UndoList = new Array();
function onClientTransferring(sender, e) {
var items = e.get_items();
for (var i = 0; i < items.length; i++) {
var item = items[i];
if (item.get_text() != "Select" || item.get_value() != "") {
UndoList.push(item);
UndoList.push(e.get_sourceListBox());
UndoList.push(e.get_destinationListBox());
sender.transferItem(item, e.get_sourceListBox(),e.get_destinationListBox());
}
}
}
function undoChanges() {
if (UndoList[UndoList.length - 1]._clientStateFieldID == "rlbStations_ClientState") {
var listbox = $find('rlbStations');
}
else if (UndoList[UndoList.length - 1]._clientStateFieldID == "rlbAllowedStations_ClientState") {
var listbox = $find('rlbAllowedStations');
}
listbox.transferItem(UndoList[UndoList.length - 3], UndoList[UndoList.length - 2], UndoList[UndoList.length - 1]);
}
는 그리고 그것은이 전송 버튼에 내장 된 사용 않습니다. – cjohnson2136
다른 버튼을 사용하려고했지만 코드를 치지도 못했습니다. 링크 된 기사조차도 기본 전송 단추를 사용하지 않는다는 언급이 없습니다. – cjohnson2136
다른 단추 또는 선택 항목에서 onClientTransferring을 호출해야합니다. 이것은 단지 최종 코드가 아니라 예제 코드였습니다. – msigman