EasyUI Forum
June 21, 2024, 01:10:54 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Difference between addRow and appendRow edatagrid  (Read 13211 times)
Spike
Newbie
*
Posts: 22


View Profile
« on: November 26, 2014, 04:21:12 AM »

Hello,

I have a question concerning appendRow en addRow in a edatagrid.

appendRow is not working;

addRow works fine. But why are there two methods to add a record?
(and what is the difference with insert?)

THIS CODE WORKS WELL;

 $('#dg_hvs').edatagrid('addRow',{
   boekjaar             : 14,
   dossiernummer         : '98765'
});
                  
$('#dg_hvs').datagrid('saveRow');  //


THIS CODE WORKS NOT BUT

 $('#dg_hvs').edatagrid('appendRow',{
   boekjaar             : 14,
   dossiernummer         : '98765'
});


Thanks in advance for your help.

Spike




« Last Edit: November 26, 2014, 04:30:16 AM by Spike » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: November 26, 2014, 07:36:25 AM »

Calling 'appendRow' method can only append a row to the end of rows. This appended row is not editable. When calling 'addRow' method to add a new row, the added row is editable. The 'addRow' method also allows the user to insert a new row to any position.
Code:
// append an empty row
$('#dg').edatagrid('addRow');

// append an empty row as first row
$('#dg').edatagrid('addRow',0);

// insert a row with default values
$('#dg').edatagrid('addRow',{
index: 2,
row:{
name:'name1',
addr:'addr1'
}
});
Logged
Spike
Newbie
*
Posts: 22


View Profile
« Reply #2 on: November 26, 2014, 07:52:11 AM »

Ok Thanks. It's clear for me now! Grin
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!