EasyUI Forum
May 15, 2024, 08:38:19 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: appending multiple rows  (Read 3839 times)
gib65
Newbie
*
Posts: 29


View Profile Email
« on: June 13, 2017, 01:27:40 PM »

Hello,

I'm experimenting with EasyUI's PropertyGrid. I see that one can append rows with the following line:

$('#easyuiPropertyGrid').propertygrid('appendRow', row);

But I'm wondering if there's a way to append multiple rows all at once, something like:

$('#easyuiPropertyGrid').propertygrid('appendMultipleRows', rows);

I'm following along with this site here:

https://www.jeasyui.com/documentation/propertygrid.php

Near the bottom of the page, it gives an example of row data:

{"total":4,"rows":[
    {"name":"Name","value":"Bill Smith","group":"ID Settings","editor":"text"},
    {"name":"Address","value":"","group":"ID Settings","editor":"text"},
    {"name":"SSN","value":"123-456-7890","group":"ID Settings","editor":"text"},
    {"name":"Email","value":"bill@gmail.com","group":"Marketing Settings","editor":{
        "type":"validatebox",
        "options":{
            "validType":"email"
        }
    }}
]}

...but it doesn't give an example of how to append this to the property grid. What good is this if it can't be added to the property grid?
Logged
qianet
Newbie
*
Posts: 9


View Profile Email
« Reply #1 on: June 13, 2017, 01:43:08 PM »

var data={"total":4,"rows":[
    {"name":"Name","value":"Bill Smith","group":"ID Settings","editor":"text"},
    {"name":"Address","value":"","group":"ID Settings","editor":"text"},
    {"name":"SSN","value":"123-456-7890","group":"ID Settings","editor":"text"},
    {"name":"Email","value":"bill@gmail.com","group":"Marketing Settings","editor":{
        "type":"validatebox",
        "options":{
            "validType":"email"
        }
    }}
]};

$('#easyuiPropertyGrid').propertygrid('loadData', data);

or

$('#easyuiPropertyGrid').propertygrid({url: 'get_data.php',......});

get_data.php return data, the format same as 'var data=....'
Logged
gib65
Newbie
*
Posts: 29


View Profile Email
« Reply #2 on: June 13, 2017, 02:34:26 PM »

Thanks qianet, that works!
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!