<jQuery EasyUI最新試用版免費下載>html
本教程爲您演示如何放置一個複選框到數據網格中。經過複選框用戶將能夠選擇選中/取消選中網格行數據。json
想要添加一個複選框列,用戶只須要添加一個列的checkbox屬性,並將其設置爲true。代碼以下所示:url
<
table
id
=
"tt"
title
=
"Checkbox Select"
class
=
"easyui-datagrid"
style
=
"width:550px;height:250px"
url
=
"data/datagrid_data.json"
idfield
=
"itemid"
pagination
=
"true"
iconcls
=
"icon-save"
>
<
thead
>
<
tr
>
<
th
field
=
"ck"
checkbox
=
"true"
></
th
>
<
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
=
"100"
>Attribute</
th
>
<
th
field
=
"status"
width
=
"60"
align
=
"center"
>Status</
th
>
</
tr
>
</
thead
>
</
table
>
上面的代碼添加了一個帶有checkbox屬性的列,因此它將成爲複選框列。若是idField屬性已設置,數據網格的選擇集合將保持在不一樣的頁面。spa
有興趣的朋友能夠點擊查看更多有關jQuery EasyUI的教程!code