jqGrid怎么给某个单元格添加事件

abc123_java 2013-07-25 11:29:20
我在编辑行editRow,所以如果在用onCellSelect就冲突了,且,我想要的是只为某个确定的单元格添加事件,其他的则不要,如:colNames:['序号','商品编号','条形码','商品名称'],
colModel:[
{name:'idp',index:'idp',width:80,editable:true}, {name:'code',index:'code', width:110,editable:true},
{name:'txm',index:'txm', width:100,editable:true},
{name:'name',index:'name', width:100,editable:true}
该表格就一行数据,只为code 单元格添加事件,怎么弄的
...全文
9223 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
引用 5 楼 u011051356 的回复:
[quote=引用 4 楼 u011051356 的回复:] [quote=引用 2 楼 rui888 的回复:] 自定义事件 。
{name:'code',index:'code',formatter: cLink, width:110,editable:true},


function cLink(cellvalue, options, rowObject){
return '<a href="javascript:void(0)" onclick="">xxx</a>';
} 
引用 2 楼 rui888 的回复:
自定义事件 。
{name:'code',index:'code',formatter: cLink, width:110,editable:true},


function cLink(cellvalue, options, rowObject){
return '<a href="javascript:void(0)" onclick="">xxx</a>';
} 
多谢[/quote] 该单元格要获得焦点呢,怎么写[/quote]

onCellSelect:function(rowid, index, contents, event){
$("#"+rowid+"_planprice").change(function(){
	$("#"+rowid+"_planmoney").val($("#"+rowid+"_planprice").val() * $("#"+rowid+"_plannum").val() );
});
}
change 事件可以改为blur或focus
abc123_java 2013-07-25
  • 打赏
  • 举报
回复
引用 4 楼 u011051356 的回复:
[quote=引用 2 楼 rui888 的回复:] 自定义事件 。
{name:'code',index:'code',formatter: cLink, width:110,editable:true},


function cLink(cellvalue, options, rowObject){
return '<a href="javascript:void(0)" onclick="">xxx</a>';
} 
引用 2 楼 rui888 的回复:
自定义事件 。
{name:'code',index:'code',formatter: cLink, width:110,editable:true},


function cLink(cellvalue, options, rowObject){
return '<a href="javascript:void(0)" onclick="">xxx</a>';
} 
多谢[/quote] 该单元格要获得焦点呢,怎么写
abc123_java 2013-07-25
  • 打赏
  • 举报
回复
引用 2 楼 rui888 的回复:
自定义事件 。
{name:'code',index:'code',formatter: cLink, width:110,editable:true},


function cLink(cellvalue, options, rowObject){
return '<a href="javascript:void(0)" onclick="">xxx</a>';
} 
引用 2 楼 rui888 的回复:
自定义事件 。
{name:'code',index:'code',formatter: cLink, width:110,editable:true},


function cLink(cellvalue, options, rowObject){
return '<a href="javascript:void(0)" onclick="">xxx</a>';
} 
多谢
abc123_java 2013-07-25
  • 打赏
  • 举报
回复
引用 1 楼 showbo 的回复:
给正在编辑的行添加onCellSelect事件?没明白具体要表达什么。。
为某个确定的单元格添加事件,不用onCellSelect,如:失去焦点事
tony4geek 2013-07-25
  • 打赏
  • 举报
回复
自定义事件 。
{name:'code',index:'code',formatter: cLink, width:110,editable:true},


function cLink(cellvalue, options, rowObject){
return '<a href="javascript:void(0)" onclick="">xxx</a>';
} 
Go 旅城通票 2013-07-25
  • 打赏
  • 举报
回复
给正在编辑的行添加onCellSelect事件?没明白具体要表达什么。。

87,902

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧