//                    ,
//                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")
                }
            });
    }

最新文章

  1. 【原创】自己动手写工具----XSmartNote [Beta 2.0]
  2. 微信开发笔记:公众号获取access_token
  3. php配置中的register_globals用法
  4. [转] C#中的Dictionary的使用
  5. Windows下使用Visual Studio 2010编译ffmpeg全过程
  6. android studio引入第三方包记录
  7. 同样的一句SQL语句在pl/sql 代码块中count 没有数据,但是直接用SQl 执行却可以count 得到结果
  8. struts2设置&lt;s:select&gt;默认选中项的方法
  9. HDFS笔记——技术点汇总
  10. border-image详解
  11. xapp1151_Param_CAM模块安装
  12. web报表工具FineReport常用函数的用法总结(文本函数)
  13. rest_framework中视图相关
  14. bash 调试
  15. 10、java5线程池之返回结果的任务之Callable与Future
  16. Process和Thread在指定CPU运行
  17. python nose测试框架全面介绍八---接口测试中非法参数的断言
  18. java基础解析系列(六)---注解原理及使用
  19. Linux基础命令---gunzip
  20. 看黑客如何远程黑掉一辆汽车 - BlackHat 2015 黑帽大会总结 day 1

热门文章

  1. 玩转Slot Machine
  2. jQuery阻止冒泡和HTML默认操作
  3. mac下安装redis
  4. 在windows服务器中,将MongoDB服务化。
  5. 如何实现zs无限期试用
  6. discuz X2.5自己写代码,获取当前登录的用户信息
  7. WPF如何卸载U盘(弹出USB设备)
  8. WPF简单入门总结
  9. PS 颜色表大全-颜色中文名(1)
  10. 使用Entity Framework时要注意的一些性能问题