Easyui DataGrid checkbox Multiple columns has been done

Source: Internet
Author: User

lengku1987 2013-01-06 22:27:47
Sponsored Links easyui DataGrid checkbox Multiple columns has been done? It is not a possible to do AH.
Sponsored Links
xuan07512013-01-06 23:07:28 Multiple columns with checkbox?
jerryflex2013-01-06 23:28:34 Ah how 2 has the checkbox box how does?
fine2092013-01-06 23:56:18 {field: ' id ', title: ', Width:10, checkbox:true},
{field: ' Name1 ', title: ' Name1 ', Width:10, checkbox:true},
{field: ' Name2 ', title: ' Name2 ', Width:10, checkbox:true} ...
yangyile19892013-01-07 00:25:05 This is the can click it? Seems not right click on a choice on the other is.
zfh052192013-01-07 00:40:55 It is your want to achieve cell selected? Then try-to-use the field's property editor, type = checkbox
zhangruihu92013-01-07 00:58:15 I have the encountered this problem, it is solved?
wizardzc2013-01-07 01:17:45
+1
ruler20092013-01-07 01:42:37
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<title>complex datagrid-jquery Easyui demo</title>
<link rel= "stylesheet" type= "Text/css" href= ". /themes/default/easyui.css ">
<link rel= "stylesheet" type= "Text/css" href= ". /themes/icon.css ">
<link rel= "stylesheet" type= "Text/css" href= "Demo.css" >
<script type= "Text/javascript" src= ". /jquery-1.6.min.js "></script>
<script type= "Text/javascript" src= ". /jquery.easyui.min.js "></script>
<script>
$ (function () {
$ (' #test '). DataGrid ({
Title: ' My DataGrid ',
Iconcls: ' Icon-save ',
width:700,
HEIGHT:350,
Nowrap:false,
Striped:true,
Collapsible:true,
URL: ' Datagrid_data.json ',
Sortname: ' Code ',
SortOrder: ' Desc ',
Remotesort:false,
IDfield: ' Code ',
frozencolumns:[[
{field: ' CK ', checkbox:true},
{title: ' Code ', field: ' Code ', width:80,sortable:true}
]],
columns:[[
{title: ' Base information ', Colspan:3},
{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:220,rowspan:2,sortable:true,
Sorter:function (A, b) {
return (A&GT;B?1:-1);
}
},
{field: ' Col4 ', title: ' Col41 ', Width:150,rowspan:2}
]],
Pagination:true,
Rownumbers:true,
toolbar:[{
ID: ' Btnadd ',
Text: ' Add ',
Iconcls: ' Icon-add ',
Handler:function () {
$ (' #btnsave '). LinkButton (' Enable ');
Alert (' Add ')
}
},{
ID: ' Btncut ',
Text: ' Cut ',
Iconcls: ' Icon-cut ',
Handler:function () {
$ (' #btnsave '). LinkButton (' Enable ');
Alert (' Cut ')
}
},‘-‘,{
ID: ' Btnsave ',
Text: ' Save ',
Disabled:true,
Iconcls: ' Icon-save ',
Handler:function () {
$ (' #btnsave '). LinkButton (' disable ');
Alert (' Save ')
}
}]
});
var p = $ (' #test '). DataGrid (' Getpager ');
$ (P). Pagination ({
Onbeforerefresh:function () {
Alert (' before Refresh ');
}
});
});
function Resize () {
$ (' #test '). DataGrid (' resize ', {
width:700,
height:400
});
}
function getselected () {
var selected = $ (' #test '). DataGrid (' getselected ');
if (selected) {
Alert (selected.code+ ":" +selected.name+ ":" +selected.addr+ ":" +selected.col4 ");
}
}
function Getselections () {
var ids = [];
var rows = $ (' #test '). DataGrid (' Getselections ');
for (Var i=0;i<rows.length;i++) {
Ids.push (Rows[i].code);
}
Alert (Ids.join (': '));
}
function Clearselections () {
$ (' #test '). DataGrid (' Clearselections ');
}
function SelectRow () {
$ (' #test '). DataGrid (' SelectRow ', 2);
}
function Selectrecord () {
$ (' #test '). DataGrid (' Selectrecord ', ' 002 ');
}
function Unselectrow () {
$ (' #test '). DataGrid (' Unselectrow ', 2);
}
function MergeCells () {
$ (' #test '). DataGrid (' MergeCells ', {
Index:2,
Field: ' Addr ',
Rowspan:2,
Colspan:2
});
}
</script>
<body>
<div class= "Demo-info" >
<div class= "Demo-tip icon-tip" ></div>
<div>click the button to doing actions with datagrid.</div>
</div>

<div style= "margin:10px 0;" >
<a href= "#" onclick= "getselected ()" >GetSelected</a>
<a href= "#" onclick= "Getselections ()" >GetSelections</a>
<a href= "#" onclick= "SelectRow ()" >SelectRow</a>
<a href= "#" onclick= "Selectrecord ()" >SelectRecord</a>
<a href= "#" onclick= "Unselectrow ()" >UnselectRow</a>
<a href= "#" onclick= "Clearselections ()" >ClearSelections</a>
<a href= "#" onclick= "resize ()" >Resize</a>
<a href= "#" onclick= "MergeCells ()" >MergeCells</a>
</div>

<table id= "Test" ></table>

</body>


can be achieved,
TD class= "Pbleft" rowspan= "1" align= "center" >koalas20092013-01-07 02:08:38
 set the Selected row when, checkbox isn't checked, the checkbox is selected, it's not selected row, set the following:
Checko Nselect:false,
; Selectoncheck:false,

There is a method this uses formatter generates checkbox, then select th e checkbox, when selected won't is associated with the entire line.
wzx8706062013-01-07 02:25:00 function Deletecheckboxevent (eventName) {
$ ("# MessageBox1"). Unbind (EventName);
$ ("# EmailBox1"). Unbind (EventName);
$ ("# PayBox1"). Unbind (EventName);
$ ("# all"). Unbind (EventName);
}
Explained:lift off checkbox the Click event. If the read data from the background once again refresh the table and continue to lift.

Easyui DataGrid checkbox Multiple columns has been done

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.