easyui datagrid checkbox multiple columns have been done do


lengku1987

2013-01-06 22:27:47

Sponsored Links

easyui datagrid checkbox multiple columns have been done do? it is not possible to do ah.

Sponsored Links


xuan0751

2013-01-06 23:07:28

multiple columns with checkbox?


jerryflex

2013-01-06 23:28:34

ah how 2 have checkbox box how to do?


fine209

2013-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} ...


yangyile1989

2013-01-07 00:25:05

this way you can click it? seems not right click on a choice on the other are.


zfh05219

2013-01-07 00:40:55

it is you want to achieve cell selected? Then you try to use the field‘s property editor, type = checkbox


zhangruihu9

2013-01-07 00:58:15

I have encountered this problem, it was solved?


wizardzc

2013-01-07 01:17:45

+1


ruler2009

2013-01-07 01:42:37

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "

<html>
<head>
	<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>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>
</head>
<body>
	<h2>Complex DataGrid</h2>
	<div class="demo-info">
		<div class="demo-tip icon-tip"></div>
		<div>Click the button to do 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>
</html>

can be achieved,


koalas2009

2013-01-07 02:08:38

Set the selected row when, checkbox is not checked, the checkbox is selected, it is not selected row, set the following:
checkOnSelect: false,
; selectOnCheck: false,

there is a method that uses formatter generates checkbox, then select the checkbox, when selected will not be associated with the entire line.


wzx870606

2013-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.

时间: 2024-10-29 04:40:30

easyui datagrid checkbox multiple columns have been done do的相关文章

jQuery easyui dataGrid checkbox反显的值取不到

  使用jQuery easyui dataGrid checkbox反显后通过      var arr = $('#butnSource').datagrid( 'getSelections'); var arr1 = $('#butnSource' ).datagrid('getSelected');   通过以上的方法取不到反显的值. 解决方案 :                        $( '#butnSource').datagrid({ url : 'sourceActio

jQuery EasyUI DataGrid Checkbox

转自:http://blog.csdn.net/baronyang/article/details/9323463 这一篇将会说明两种使用 jQuery EasyUI DataGrid 的 Checkbox 设定方式,以及在既有数据下将 checked 为 true 的该笔数据列的 Checkbox 设定为 Checked,另外就是两种 Checkbox 设定方式下如何取得有勾选的数据. 有关 jQuery EasyUI DataGrid 的相关资料,可以前往官网查看, jQuery EasyU

easyui datagrid checkbox的相关属性整理

DataGrid其中与选择,勾选相关 DataGrid属性: singleSelect boolean 如果为true,则只允许选择一行. false ctrlSelect boolean 在启用多行选择的时候允许使用Ctrl键+鼠标点击的方式进行多选操作.(该属性自1.3.6版开始可用) checkOnSelect boolean 如果为true,当用户点击行的时候该复选框就会被选中或取消选中.如果为false,当用户仅在点击该复选框的时候才会呗选中或取消.(该属性自1.3版开始可用) tru

easyui datagrid 动态添加columns属性

公司在项目设计的时候,有一个需求,就是查出来的表的字段不唯一,一张表的字段可能是三个,也可能是五个,但是却要把它显示到页面,这个给我做ui的带来一点麻烦.因为以前一般用easyui 的datagrid里的columns属性都是对应数据库表里的字段,现在字段都不知道,怎么用datagrid显示数据呢?本人在这里介绍最笨的办法,就是拼接出columns 属性的格式,我承认,我的办法效率不高,但是当你无从下手的时候,,这未尝不是解决问题的办法,当然在解决这个问题之前,我也百度了一下,试了一些办法,有的

jQuery EasyUI DataGrid Checkbox 数据设定与取值

$('#dg').datagrid({ title: 'CheckBox Selection on DataGrid', url: 'datagrid_data3.json', width: '700', rownumbers: true, columns:[[ { field:'ck',checkbox:true }, { field: 'productid', title: 'productid' }, { field: 'productname', title: 'productname'

easyui datagrid 动态拼接columns以及赋值

需求背景如下: 后台java代码动态拼接datagrid的columns,然后赋值,实现过程如下: 后台java代码拼接过程,只是举个例子,可以根据具体业务拼接: java代码: Map<String, Object> map = new HashMap<String,Object>(); StringBuffer cols = new StringBuffer(); cols.append("[["); cols.append("{field:\&q

easyui datagrid checkbox选中事件

$('#grid_Order').datagrid({       onCheck: function(index, data) { //alert(data[0]);               //alert(index );               $("#ChangeCore_order_id").html(data[0]);//赋值 赋安装工单id 换芯 维修 用               $("#Repair_order_id").html(dat

easyui datagrid editor checkbox 单击事件

Easyui datagrid treegrid中能够为行追加checkbox元素.比如: $('#tt').treegrid({ url:'get_data.php', idField:'id', treeField:'name', columns:[[ {title:'Task Name',field:'name',width:180}, {field:'persons',title:'Persons',width:60,align:'right'}, {field:'begin',titl

EasyUI datagrid 的checkbox设置

参考url: http://blog.csdn.net/baronyang/article/details/9323463 我的需求: 抓取数据生成的日志,日志中有部分是抓取失败的,需要将失败的发送到另一个部分,但是成功了的就不需要发送; 设置checkbox: <th data-options="field:'checked',formatter:formatCK"><input type="checkbox" id="ckAll&qu