jquery easyui datagrid 双击编辑某一个单元格

show出数据

grid = $('#grid').datagrid({
			title : '',
			url : contextPath + '/base/xxxxxxxxxxxxx!grid.do',
			queryParams: params,
			idField : 'id',
			rownumbers : true,
			pagination : true,
			pageSize : 50,
			pageList : [ 10, 20, 30, 40, 50, 100, 200, 300, 400, 500 ],
			frozenColumns : [ [ 
						{field:'id',checkbox:true},
							{
								width : '100',
								title : '用户手机号',
								field : 'phoneno'
							}
				      ] ],
			columns : [ [ 
			 			{
			 				width : '100',
			 				title : '业务员',
			 				field : 'recycleman'
			 			},
			 			{
			 				width : '150',
			 				title : '手机型号',
			 				field : 'mobileModel'
			 			}
			 		]
				],
			toolbar : '#toolbar',
			onClickCell:function(index,field,value){        //*单击本行关闭单元格编辑状态
				$(this).datagrid('endEdit', index); 
			},
			onDblClickCell:function(index,field,value){     //*双击单元格编辑
				$(this).datagrid('beginEdit', index);
				var ed = $(this).datagrid('getEditor', {index:index,field:field});
				$(ed.target).focus();
			},
			onBeforeLoad : function(param) {
				parent.$.messager.progress({
					text : '数据加载中....'
				});
			},
			onLoadSuccess : function(data) {
				$('.iconImg').attr('src', sy.pixel_0);
				parent.$.messager.progress('close');
			}
		});

批量提交按钮

<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-note_add',plain:true" onclick="confirmFunModify();">批量修改</a></td>

批量修改提交方法

function confirmFunModify(){
	    var checkedItems = $('#grid').datagrid('getChecked');
	    var idArr = [];
	    $.each(checkedItems, function(index, item){
	    	idArr.push(item.id+':'+item.realSellPrice);
	    });                
	    var idAndRealSellPrice = idArr.join(",");
	    if(idAndRealSellPrice.length == 0){
	    	alert("请至少选择一条记录!");
	    	return;
	    }
	    parent.$.messager.confirm('询问', '您确定要批量修改所选记录?', function(r) {
			if (r) {
				$.post(contextPath + '/base/xxxxxxxxxx!modifySellPrice.do', {
					idAndRealSellPrice : idAndRealSellPrice,
				}, function(result) {
					if (result.success) {
						grid.datagrid('reload');
						alert(result.msg);
					} else {
						alert(result.msg);
					}
					
				}, 'json');
			}
		});
	    
	}


end!!!!!!!!!!!!!!!!!









转载于:https://my.oschina.net/u/1182648/blog/539327

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值