datagrid "index"指的是行号吗? function editrow(index) { $.messager.alert(index); $('#tt').datagrid('beginEdit', index);}为什么index是undefined?我是通过点击表格“编辑”链接。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $(function(){ var grid = new easyui.datagrid({ title:"商品列表", renderer:"gridlist", onBeforeEdit:function(index,row) { row.editing = true; //$(this).datagrid("selectRow",index); $(this).datagrid("refreshRow",index); }, onAfterEdit:function(index,row) { row.editing = false; //$(this).datagrid("selectRow",index); $(this).datagrid("refreshRow",index); }, onCancelEdit:function(index,row) { row.editing = false; $(this).datagrid("refreshRow",index); }, /* 是否支持双击打开编辑 onDblClickCell:function(index,field,value) { $(this).datagrid("beginEdit",index); $(this).dategrid("getEditor",{index:index,field:"LOWER_LIMIT"}); }, */ columns:[[ {title:"物品ID",field:"GOODS_ID",width:30,hidden:true}, {title:"库存警戒值",field:"LOWER_LIMIT",width:100,align:"center",editor:"numberbox"}, {title:"操作",field:"opera",width:120,align:"center",formatter: function(value,row,index) { if(row.editing) { var s = "<a href='#' onclick='save(" + index + ")'>保存</a>"; var c = "<a href='#' onclick='cancel(" + index + ")'>取消</a>"; return s + " " + " " + c; } else { var e = "<a href='#' onclick='edit(" + index + ")'>编辑</a>"; return e ; } } }, ]], });已贴! 另问:如何获取datagrid中某一列的全部值,并保存到数组中?是用getEditor吗? highcharts画图的原理是什么 当点击一个按钮的时候,请问如何清空div里面<input>标签里的text的值 请教:打开弹出窗口前,先判断已经弹出了同样的窗口 请问jiavascript 里面回车的定义 火狐瀏覽器下獲取焦點問題 高分求助 客户端如何取得控件的clientid 请问js里面如何调javabean类丫,在线等待哦~~ 为什么这滚动小图片在IE9以上版本 显示不一样呢 显示引号的问题(keywords:HtmlEditer,jsp,") 怎样在本地判断是否和服务器已断开连接? 请帮忙加入一个输入文框 javascript变量赋值el表达式出错
$(function(){
var grid = new easyui.datagrid({
title:"商品列表",
renderer:"gridlist",
onBeforeEdit:function(index,row) {
row.editing = true;
//$(this).datagrid("selectRow",index);
$(this).datagrid("refreshRow",index);
},
onAfterEdit:function(index,row) {
row.editing = false;
//$(this).datagrid("selectRow",index);
$(this).datagrid("refreshRow",index);
},
onCancelEdit:function(index,row) {
row.editing = false;
$(this).datagrid("refreshRow",index);
},
/* 是否支持双击打开编辑
onDblClickCell:function(index,field,value) {
$(this).datagrid("beginEdit",index);
$(this).dategrid("getEditor",{index:index,field:"LOWER_LIMIT"});
},
*/
columns:[[
{title:"物品ID",field:"GOODS_ID",width:30,hidden:true},
{title:"库存警戒值",field:"LOWER_LIMIT",width:100,align:"center",editor:"numberbox"},
{title:"操作",field:"opera",width:120,align:"center",formatter:
function(value,row,index) {
if(row.editing) {
var s = "<a href='#' onclick='save(" + index + ")'>保存</a>";
var c = "<a href='#' onclick='cancel(" + index + ")'>取消</a>";
return s + " " + " " + c;
} else {
var e = "<a href='#' onclick='edit(" + index + ")'>编辑</a>";
return e ;
}
}
},
]],
});
已贴!