创建属性网格


属性网格(property grid)带有一个内置的 expand(展开)/collapse(合并) 按钮,可以简单地为行分组。您可以简单地创建一个可编辑属性的分层(hierarchical)列表。

设置 HTML

  1. <table id="tt" class="easyui-propertygrid" style="width:300px"
  2. url="propertygrid_data.json"
  3. showGroup="true" scrollbarSize="0"
  4. ></table>

准备 json 数据

  1. [
  2. {"name":"Name","value":"Bill Smith","group":"ID Settings","editor":"text"},
  3. {"name":"Address","value":"","group":"ID Settings","editor":"text"},
  4. {"name":"Age","value":"40","group":"ID Settings","editor":"numberbox"},
  5. {"name":"Birthday","value":"01/02/2012","group":"ID Settings","editor":"datebox"},
  6. {"name":"SSN","value":"123-456-7890","group":"ID Settings","editor":"text"},
  7. {"name":"Email","value":"bill@gmail.com","group":"Marketing Settings","editor":{
  8. "type":"validatebox",
  9. "options":{
  10. "validType":"email"
  11. }
  12. }},
  13. {"name":"FrequentBuyer","value":"false","group":"Marketing Settings","editor":{
  14. "type":"checkbox",
  15. "options":{
  16. "on":true,
  17. "off":false
  18. }
  19. }}
  20. ]

正如您所看到的,属性网格(property grid)的创建不需要任何的 javascript 代码。您可以简单地继承扩展 editor 类型。

下载 jQuery EasyUI 实例

下载地址