EasyUI Forum
May 06, 2024, 12:59:32 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: how to set row can only drop in it's own grid?  (Read 3104 times)
James
Jr. Member
**
Posts: 52


View Profile Email
« on: August 21, 2018, 12:48:40 AM »

I set grid with id 'grid' and set dropAccept:'#grid tr.datagrid-row', but it's not working, because grid table are not really in #grid element;
have to set a parent panel with id 'box' and set dropAccept:'#box tr.datagrid-row' to make it work.
is there any convenient way?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: August 21, 2018, 02:28:08 AM »

Try this code:
Code:
<table class="easyui-datagrid" title="DataGrid" style="width:400px;height:250px" data-options="
      singleSelect:true,
      cls:'mydatagrid',
      dropAccept:'.mydatagrid tr.datagrid-row',
      data:data,
      onLoadSuccess:function(){
        $(this).datagrid('enableDnd');
      }
    ">
  <thead>
    <tr>
      <th data-options="field:'itemid',width:80">Item ID</th>
      <th data-options="field:'productid',width:100">Product</th>
      <th data-options="field:'listprice',width:80,align:'right'">List Price</th>
      <th data-options="field:'unitcost',width:80,align:'right'">Unit Cost</th>
      <th data-options="field:'attr1',width:250">Attribute</th>
      <th data-options="field:'status',width:60,align:'center'">Status</th>
    </tr>
  </thead>
</table>
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!