EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: gib65 on June 13, 2017, 01:27:40 PM



Title: appending multiple rows
Post by: gib65 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?


Title: Re: appending multiple rows
Post by: qianet 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=....'


Title: Re: appending multiple rows
Post by: gib65 on June 13, 2017, 02:34:26 PM
Thanks qianet, that works!