jQuery EasyUI データグリッド -プロパティグリッドの作成
プロパティグリッド(property grid)には、行をグループ化するための組み込みの expand(展開)/ collapse(折りたたみ)ボタンがあります。編集可能な属性を持つ階層(hierarchical)リストを簡単に作成できます。
HTML の設定
<table id="tt" class="easyui-propertygrid" style="width:300px"
url="propertygrid_data.json"
showGroup="true" scrollbarSize="0"
></table>
JSON データの準備
[
{"name":"Name","value":"Bill Smith","group":"ID Settings","editor":"text"},
{"name":"Address","value":"","group":"ID Settings","editor":"text"},
{"name":"Age","value":"40","group":"ID Settings","editor":"numberbox"},
{"name":"Birthday","value":"01/02/2012","group":"ID Settings","editor":"datebox"},
{"name":"SSN","value":"123-456-7890","group":"ID Settings","editor":"text"},
{"name":"Email","value":"[email protected]","group":"Marketing Settings","editor":{
"type":"validatebox",
"options":{
"validType":"email"
}
}},
{"name":"FrequentBuyer","value":"false","group":"Marketing Settings","editor":{
"type":"checkbox",
"options":{
"on":true,
"off":false
}
}}
]
ご覧のとおり、プロパティグリッド(property grid)の作成には javascript コードは一切必要ありません。editor タイプを簡単に継承して拡張できます。
jQuery EasyUI サンプルをダウンロード
jeasyui-datagrid-datagrid20.zip
その他の拡張