read_sha 2016-02-01 07:42 采纳率: 0%
浏览 2589

easyui网格拖拽$(this).datagrid('loadData',data);不能选中数据

jquery easyui 数据网格拖拽,数据已经拼接成正确格式,但是还是没有选中效果。

 <script>       $(function(){$("#filelist").datagrid({          onLoadSuccess:function(){                   $(this).datagrid('enableDnd');                              },          onStopDrag:function(row){               var rows=$(this).datagrid('getRows');               var jsdata = "{\"total\":\""+rows.length+"\",\"rows\":[";                   var initValue=1;                    for(var i in rows){                         rows[i].status=initValue;                           initValue++;                        jsdata +="{\"productid\":\""+rows[i].productid+"\",\"productname\":\""+rows[i].productname+"\",\"unitcost\":"+rows[i].unitcost+",\"status\":\""+rows[i].status+"\",\"listprice\":"+rows[i].listprice+",\"attr1\":\""+rows[i].attr1+"\",\"itemid\":\""+rows[i].itemid+"\"},";                    }                   jsdata = jsdata.substring(0,jsdata.length-1);                   jsdata += "]}";                                 var data = $.parseJSON(jsdata);                     $(this).datagrid('loadData',data);                                      }       })      })  </script> 
  • 写回答

1条回答 默认 最新

  • Go 旅城通票 2016-02-01 08:08
    关注

    datagrid有onStopDrag这个事件?自己扩展的?在这个事件中打印console.log(this)看是不是你的table那个dom对象

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!