Realtimehistory_lkj_alloption -- list on the left
Realtimehistory_lkj_selectoption -- list on the right
// Shift right
$ (". Realtimehistory_lkj_rightmove"). Unbind ("click"). Click (function (){
$. Each ($ (". realtimehistory_lkj_alloption option: Selected"), function (I, item ){
$ (". Realtimehistory_lkj_alloption option [value = '" + $ (item). Val () + "']"). Remove ();
$ (". Realtimehistory_lkj_selectoption "). append ("<option value = '" + $ (item ). val () + "'>" + $ (item ). text () + "</option> ");
});
});
// Move left
$ (". Realtimehistory_lkj_leftmove"). Unbind ("click"). Click (function (){
$. Each ($ (". realtimehistory_lkj_selectoption option: Selected"), function (I, item ){
$ (". Realtimehistory_lkj_selectoption option [value = '" + $ (item). Val () + "']"). Remove ();
$ (". Realtimehistory_lkj_alloption "). append ("<option value = '" + $ (item ). val () + "'>" + $ (item ). text () + "</option> ");
});
});
// Move all right
$ (". Realtimehistory_lkj_allrightmove"). Unbind ("click"). Click (function (){
$. Each ($ (". realtimehistory_lkj_alloption option"), function (I, item ){
$ (". Realtimehistory_lkj_alloption option [value = '" + $ (item). Val () + "']"). Remove ();
$ (". Realtimehistory_lkj_selectoption "). append ("<option value = '" + $ (item ). val () + "'>" + $ (item ). text () + "</option> ");
});
});
// Move all to the left
$ (". Realtimehistory_lkj_allleftmove"). Unbind ("click"). Click (function (){
$. Each ($ (". realtimehistory_lkj_selectoption option"), function (I, item ){
$ (". Realtimehistory_lkj_selectoption option [value = '" + $ (item). Val () + "']"). Remove ();
$ (". Realtimehistory_lkj_alloption "). append ("<option value = '" + $ (item ). val () + "'>" + $ (item ). text () + "</option> ");
});
});
// Move up
$ (". Realtimehistory_lkj_upmove"). Unbind ("click"). Click (function (){
If ($ (". realtimehistory_lkj_selectoption option: Selected"). length> 0 ){
VaR selectindex = $ (". realtimehistory_lkj_selectoption"). Get (0). selectedindex;
If (selectindex> 0 ){
$ ('. Realtimehistory_lkj_selectoption option: selected'). insertbefore ($ ('. realtimehistory_lkj_selectoption option: selected'). Prev ('option '));
} Else {
Alert ("This is the first item. ");
}
} Else {
Alert ("select one... ");
}
});
// Move down
$ (". Realtimehistory_lkj_downmove"). Unbind ("click"). Click (function (){
If ($ (". realtimehistory_lkj_selectoption option: Selected"). length> 0 ){
VaR selectlength = $ (". realtimehistory_lkj_selectoption option"). length;
VaR selectindex = $ (". realtimehistory_lkj_selectoption"). Get (0). selectedindex;
If (selectindex <selectLength-1 ){
$ ('. Realtimehistory_lkj_selectoption option: selected'). insertafter ($ ('. realtimehistory_lkj_selectoption option: selected'). Next ('option '));
} Else {
Alert ("this is the last item. ");
}
} Else {
Alert ("select one... ");
}
});
9. Option conversion in the two drop-down lists