<jQuery EasyUI最新試用版免費下載>javascript
本教程中的示例說明了如何將工具欄添加到數據網格中,您能夠在數據網格頂部的工具欄上放置按鈕。html
<
table
id
=
"tt"
class
=
"easyui-datagrid"
style
=
"width:600px;height:250px"
url
=
"data/datagrid_data.json"
title
=
"DataGrid with Toolbar"
iconcls
=
"icon-save"
toolbar
=
"#tb"
>
<
thead
>
<
tr
>
<
th
field
=
"itemid"
width
=
"80"
>Item ID</
th
>
<
th
field
=
"productid"
width
=
"80"
>Product ID</
th
>
<
th
field
=
"listprice"
width
=
"80"
align
=
"right"
>List Price</
th
>
<
th
field
=
"unitcost"
width
=
"80"
align
=
"right"
>Unit Cost</
th
>
<
th
field
=
"attr1"
width
=
"150"
>Attribute</
th
>
<
th
field
=
"status"
width
=
"60"
align
=
"center"
>Stauts</
th
>
</
tr
>
</
thead
>
</
table
>
<
div
id
=
"tb"
>
<
a
href
=
"#"
class
=
"easyui-linkbutton"
iconcls
=
"icon-add"
plain
=
"true"
onclick
=
"javascript:alert('Add')"
>Add</
a
>
<
a
href
=
"#"
class
=
"easyui-linkbutton"
iconcls
=
"icon-cut"
plain
=
"true"
onclick
=
"javascript:alert('Cut')"
>Cut</
a
>
<
a
href
=
"#"
class
=
"easyui-linkbutton"
iconcls
=
"icon-save"
plain
=
"true"
onclick
=
"javascript:alert('Save')"
>Save</
a
>
</
div
>
您不須要編寫任何JavaScript代碼,只需經過「toolbar」屬性添加工具欄到數據網格中便可。json
下載該EasyUI示例:easyui-datagrid-demo.zip工具
有興趣的朋友能夠點擊查看更多有關jQuery EasyUI的文章!ui