EasyUI Forum
April 20, 2024, 03:51:23 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: eDataGrid destroyRow Error  (Read 5397 times)
thiago_brum
Newbie
*
Posts: 26


View Profile Email
« on: May 31, 2016, 05:56:06 AM »

I have a eDataGrid ...

     <table id="datagrid_item_pedido" title="Itens" idField="id" singleSelect="true">
        <thead>
           <tr>
      <th field="action" width="18" data-options="formatter:function(value,row,index){ return '<a href=\'#\' onclick=\'deleteLine()\'>Delete</a>';}"></th>
      <th field="cod_item" width="100">Item</th>
           </tr>
        </thead>
     </table>


  $('#datagrid_item_pedido').edatagrid({
  });

  function deleteLine(){
     var row = $('#datagrid_item_pedido').datagrid('getSelected');
     var index = $('#datagrid_item_pedido').datagrid('getRowIndex',row);
     $('#datagrid_item_pedido').edatagrid('destroyRow',index);
  }

I insert two lines in eDataGrid ...

$('#datagrid_item_pedido').edatagrid('addRow',{row:{cod_item:'Test1'}});
$('#datagrid_item_pedido').edatagrid('addRow',{row:{cod_item:'Test2'}});

If i click on the link "Delete" in the first line ("Test1"), the line disappears (it's ok).
Now, if I click again on "Delete" link on the left line ("Test2"), nothing happens.
Can someone help me with this problem?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: May 31, 2016, 07:50:39 PM »

Please try to download the newest 'jquery.edatagrid.js' file from http://www.jeasyui.com/extension/edatagrid.php
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!