EASYUI- EASYUI 왼쪽 이동, 오른쪽 이동 GRID 값

3481 단어 easyui
EASYUI 왼쪽 이동 오른쪽 이동 GRID 값
$("#addAll").click(function(){

    var ids = [];

    var names = [];

    var srcrows = $('#sourceTable').datagrid('getSelections');

    if(srcrows.length == 0 ){

        Sys.InfoShow(" !");

        return;

    }

    var id;var name;



    for(var srci=srcrows.length-1;srci>=0;srci--){

    

        id = srcrows[srci].termac;

        name = srcrows[srci].tername;

        names.push(srcrows[srci].tername);

        ids.push(srcrows[srci].termac);

        

        var index = $('#sourceTable').datagrid('getRowIndex', srcrows[srci]);

        $('#sourceTable').datagrid('deleteRow', index);

        $('#targetTable').datagrid('appendRow',{'termac':id,'tername':name});

    

  

    }



});

       

$("#disAll").click(function(){

    var ids_tag = [];

    var names_tag = [];

    var tagrows = $('#targetTable').datagrid('getSelections');

    if(tagrows.length == 0 ){

        Sys.InfoShow(" !");

        return;

    }

    var id_tag,name_tag;

    for(var i=tagrows.length-1;i>=0;i--){

        id_tag = tagrows[i].termac;

        name_tag = tagrows[i].tername;

        names_tag.push(tagrows[i].tername);

        ids_tag.push(tagrows[i].termac);

        var index = $('#targetTable').datagrid('getRowIndex', tagrows[i]);

        $("#targetTable").datagrid('deleteRow',index);

        $('#sourceTable').datagrid('appendRow',{'termac':id_tag,'tername':name_tag});

    }    

})

좋은 웹페이지 즐겨찾기