EasyUI Forum
October 18, 2025, 02:51:03 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: Can I insert dynamic rows,after the columns is created dynamic in datagrid?  (Read 8193 times)
cdy328
Newbie
*
Posts: 7


View Profile
« on: April 26, 2015, 08:15:58 PM »

I have dynamic columns,and defined it's "field",
but when I use the method "appendRow",then show errors:
"SyntaxError: missing : after property id",
but it works well in this method "newID0:0"
(the value of "fields[1]" is "newID0")

How can I change my codes,if I want dynamic columns and dynamic
rows in datagrid?

Thanks in advance Smiley

// create dynamic columns
columns[0].push({
   title : result.operatorUserName,
   // define "field" here,and later,I put it to fields[]
   field : "newID" + i,
   width : 90
});

// append dynamic rows
for(var m=0; m<items.length; m++){
   $('#id_list_query').edatagrid(
   'appendRow',{
      //"SyntaxError: missing : after property id"
      fields[1]:0
      // bug,it works well when use "newID0:0"
   });
}
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: April 27, 2015, 07:27:10 AM »

To dynamic change the datagrid's columns, please refer to this tutorial http://www.jeasyui.com/tutorial/datagrid/datagrid6.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!