Code highlighting produced by Actipro Codehighlighter (freeware) http://www. codehighlighter.com/--><title>DataGrid</title>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<script src= ". /jquery-1.4.2.min.js "type=" Text/javascript "></script>
<script src= ". /jquery.easyui.min.js "type=" Text/javascript "></script>
<link href= ". /themes/default/easyui.css "rel=" stylesheet "type=" Text/css "/>
<link href= ". /themes/icon.css "rel=" stylesheet "type=" Text/css "/>
<script type= "Text/javascript" >
$ (function () {
$ (' #test '). DataGrid ({
Title: ' JQuery easyui---DataGrid ',
Iconcls: ' Icon-save ',
WIDTH:500,
HEIGHT:350,
Nowrap:false,
Striped:true,
URL: '.. /data/datagrid_data.json ',
Sortname: ' ID ',
SortOrder: ' Desc ',
IDfield: ' ID ',
FrozenColumns: [[
{field: ' CK ', checkbox:true},
{title: ' id ', field: ' ID ', width:80, sortable:true}
]],
Columns: [[
{title: ' Basic Information ', Colspan:2},
{field: ' opt ', title: ' Operation ', width:100, align: ' center ', Rowspan:2,
Formatter:function (value, rec) {
Return ' <span style= ' color:red ' > Edit delete </span> ';
}
}
], [
{field: ' Name ', title: ' Name ', width:120},
{field: ' addr ', title: ' Address ', width:120, Rowspan:2, sortable:true}
]],
Pagination:true,
Rownumbers:true,
Singleselect:false,
Toolbar: [{
Text: ' Add ',
Iconcls: ' Icon-add ',
Handler:function () {
Alert (' Add data ')
}
}, ‘-‘, {
Text: ' Save ',
Iconcls: ' Icon-save ',
Handler:function () {
Alert (' Save Data ')
}
}]
});
});
</script>
<body>
<table id= "Test" ></table>
</body>
Effect
DataGrid Table Control