EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: jega on April 27, 2022, 07:37:17 AM



Title: [SOLVED]Datagrid insertrow and enableDnd
Post by: jega on April 27, 2022, 07:37:17 AM
Hi

Have some trouble. In another project i use enableDnd in onloadSuccess. Works.

Now i put data with insertRow and want to enableDnd on this datagrid.

With a button i can do $('#dgList').datagrid('enableDnd'), but how to enable it when inserting rows

Any help


Jesper


Title: Re: Datagrid insertrow and enableDnd
Post by: jarry on April 28, 2022, 07:12:01 AM
After insert a new row, call the 'enableDnd' method to enable the dnd feature again.
Code:
var index = 1;  // the row index to insert to
$('#dg').datagrid('insertRow', {
  index: index,
  row:{
    itemid: 'itemid1',
    productid: 'productid1',
  }
}).datagrid('enableDnd', index);


Title: Re: Datagrid insertrow and enableDnd
Post by: jega on April 28, 2022, 12:24:14 PM
of course ;-)

Thanks