Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery EasyUI Data Grid and Tree Plugin - Propertygrid Property Grid

jQuery EasyUI Data Grid and Tree Plugin - Propertygrid Property Grid


jQuery EasyUI Plugins jQuery EasyUI Plugins


Extends $.fn.datagrid.defaults. Override the default defaults via $.fn.propertygrid.defaults.

The propertygrid provides users with an interface for browsing and editing object properties. The propertygrid is an inline-editing datagrid. It is quite easy to use. Users can easily create a hierarchical list of editable properties and items representing any data type. The propertygrid comes with built-in sorting and grouping features.

Depends on

Usage

Create a propertygrid in markup. Note that the columns are built-in and need not be declared again.



Create a propertygrid using JavaScript.





$('#pg').propertygrid({

    url: 'get_data.php',

    showGroup: true,

    scrollbarSize: 0

});

Append a new row to the propertygrid.



var row = {

    name:'AddName',

    value:'',

    group:'Marketing Settings',

    editor:'text'

};

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

Row Data

The propertygrid extends from the datagrid. Its row data format is the same as the datagrid. As a property row, the following fields are required:
name: field name.
value: the field value to be edited.
group: the field value of the group.
editor: the editor used to edit the property value.

Row data example:



{"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"

        }

    }}

]}

property

This property extends from the datagrid. The following are properties added for the propertygrid.

Name Type Description Default value
showGroup boolean Defines whether to show property groups. false
groupField string Defines the field name of the group. group
groupFormatter function(group,rows) Defines how to format the group value. This function includes the following parameters:
 group:组的字段名。       

 rows:属于改组的行。 |  |

Method

This method extends from the datagrid. The following are methods added for the propertygrid.

Name Parameters Description
expandGroup groupIndex Expand the specified group. If the 'groupIndex' parameter is not assigned, all groups are expanded.
collapseGroup groupIndex Collapse the specified group. If the 'groupIndex' parameter is not assigned, all groups are collapsed.

jQuery EasyUI Plugins jQuery EasyUI Plugins