• js设置datagriad的行移动


       //                    ,
    //                formatter: function(value,row,index){
    //                    var download = row.priority+
    //                        "&nbsp;&nbsp;&nbsp;<a href="#" id = "V_up_"+index+"" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick=moveUp(this,"
    //                                + index+ ","+row.priority+","+row.id+")>上移</a>"
    //                                 +"<a href="#" id = "V_down_"+index+"" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick=movedown(this,"
    //                                + index+ ")>下移</a>";
    //                    return download;
    //                    }
    function moveUp(value, index, priority,id) { var $tr = $(value).parents("tr"); if ($tr.index() != 0) { $tr.fadeOut().fadeIn(); $tr.prev().before($tr); } var columns = $('#dataGrid').datagrid("options").columns; // 得到rows对象 var rows = $('#dataGrid').datagrid("getRows"); // 这段代码是// 对某个单元格赋值 var changeRows = ""; var beichangeRows =""; if(index == 0){ beichangeRows = 2; changeRows = 1; }else{ changeRows = rows[index-1].priority; beichangeRows = priority; } //进入后台更新优先级 updatePriority(rows[index].id+"@"+changeRows,rows[index-1].id+"@"+beichangeRows); } function movedown(value, index,row) { var len = value.length; var $tr = $(value).parents("tr"); if ($tr.index() != len - 1) { $tr.fadeOut().fadeIn(); $tr.next().after($tr); } var columns = $('#dataGrid').datagrid("options").columns; // 得到rows对象 var rows = $('#dataGrid').datagrid("getRows"); // 这段代码是// 对某个单元格赋值 var changeRows = ""; var beichangeRows =""; if(index == len - 1){ beichangeRows =rows[index].priority; changeRows = rows[index+1].priority;; updatePriority(rows[index].id+"@"+changeRows,rows[index+1].id+"@"+beichangeRows); } }



        /**
         * 更新优先级
         * @param changeRows
         * @param beichangeRows
         */
        
        function updatePriority(changeRows,beichangeRows){
             $.ajax({
                    url: '../productConfig/updatePriority',
                    data: {"changeRows":changeRows,"beichangeRows":beichangeRows},
                    type: 'post',
                    dataType: 'json',
                    success: function(r) {
                         $('#dataGrid').datagrid("reolad")
                    }
                });
        }
  • 相关阅读:
    tar命令解压jdk.tar.gz包 报错 gzip: stdin: not in gzip format
    CentOS6.5安装完没有网络的解决办法
    UML在需求分析阶段的应用
    UML
    UML在软件开发中各个阶段的作用和意义
    Maven那点事儿(Eclipse版)
    eclipse和myeclipse的下载地址
    div的作用
    c:if标签数据回显判断是否选中
    《Hadoop》对于高级编程Hadoop实现构建企业级安全解决方案
  • 原文地址:https://www.cnblogs.com/tian830937/p/4807424.html
Copyright © 2020-2023  润新知