EasyUI Forum
May 16, 2024, 04:49:25 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: ADD 10 Blank Rows in edatagrid  (Read 5550 times)
binte.hava
Newbie
*
Posts: 5


View Profile
« on: March 07, 2014, 06:33:10 AM »

Hi!
I have a button and i want to add 10 Blank rows in the edatagrid. right now the code that i m using add only one row.

<table id="dgsv_admin" title="WORKSHEET" style="width:950px; height:460px;"
         toolbar="#toolbar" pagination="false" idField="id"
         rownumbers="false" fitColumns="false" singleSelect="true">
   
      <thead>
         <tr>
            <th field="code" width="62" editor="{type:'validatebox',options:{required:true}}">Code</th>
            <th field="type" width="64" editor="{type:'validatebox',options:{required:true}}">Type</th>
                         </tr>
               </thead>
</table>

Here is the code to add Rows to the above grid:

<button class="btn btn-success" onClick="javascript:$('#dgsv_admin').edatagrid('addRow')">ADD 10 ROWS</button>

Any solution regarding this....?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: March 07, 2014, 08:26:28 PM »

To append a row for editing, try this:
Code:
$('#dg').edatagrid('addRow');

To append a row and save it, try this:
Code:
$('#dg').edatagrid('addRow', {row:{...}}).edatagrid('saveRow');
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!