The code is as follows:
[JavaScript]View PlainCopy
- <script type="Text/javascript" >
- var DataGrid;
- $ (function () {
- $ (' #datagrid '). DataGrid ({
- URL:' {: U ("Admin/article/indexjson")} ',
- Title:",
- Iconcls:' Icon-save ',
- Fit:true,
- //The page bar below
- Pagination:true,
- Pagesize:14,
- PAGELIST:[14,20,30,40,50],
- //Whether the horizontal scroll bar appears
- Fitcolumns:True,
- //Data Wrapping
- NoWrap:false,
- Border:false,
- //help you remember that you have chosen to do the cross-page delete
-
- IDfield:' id ',
- columns:[[{
- Title:",
- Field:' ck ',
- CheckBox:True,
- Width:10,
- Rowspan:2
- },{
- Title:' ID ',
- Field:' id ',
- WIDTH:50,
- Rowspan:2,
- Align:' center '
- },{
- Title:' article title ',
- Field:' title ',
- WIDTH:350,
- Rowspan:2
- },{
- Title:' Properties ',
- Align:' center ',
- Colspan:3
- },{
- Title:' Belong to column ',
- Field:' name ',
- width:150,
- Rowspan:2
- },{
- Title:' Special topic ',
- Field:' name ',
- width:150,
- Rowspan:2
- },{
-
- Title:' Release time ',
- Field:' time ',
- width:150,
- Align:' center ',
- Rowspan:2
- }
- ],[
- {
- Title:' recommended ',
- Field:' good ',
- WIDTH:50,
- Align:' center '
- },{
- Title:' hot ',
- Field:' hits ',
- WIDTH:50,
- Align:' center '
- },{
- Title:' figure ',
- Field:' pic ',
- WIDTH:50,
- Align:' center '
- },
- ]],toolbar:"#tb"
- });
- });
- function Dosearch (value) {
- //alert (' You input: ' + value ');
- $ (' #datagrid '). DataGrid (' Load ', {
- title:$ ('#tb '). Find (' [Name=search] '). Val ()
- });
-
- }
- function Doadd () {
- //alert (' You input: ' + value ');
- }
- function Dosave (value) {
- Alert (' you input: ' + value ');
- }
- function Dodel (value) {
- Alert (' you input: ' + value ');
- }
- function Dosearch (value) {
- Alert (' You input: ' + value ');
- // }
- </script>
Create easyui DataGrid column Group (column groups) in JavaScript mode