【发布时间】:2012-05-29 02:32:35
【问题描述】:
我已经动态构建了一个jqgrid,我无法调用按钮的onclick函数。
我的代码:
function buildButtons(cellvalue, options, rowObject) {
var optionsRowId = options.rowId;
var editDelButtons = "<input style=\"height:22px;width:40px;\" type=\"button\" value=\"Edit\" onclick=\"javascript:testRow('" + optionsRowId + "')\" />";
return editDelButtons;
}
function testRow(rowID)
{
alert(rowID);
}
}
当我点击 jqgrid 每一行中的按钮时,我总是得到的错误是“函数未定义”
我的函数写在 customFormatter 函数的正下方。
请尽快帮助我,在此先感谢。
【问题讨论】:
-
你能发布一个更大的代码示例(例如:jsfiddle)来演示这个问题吗?
标签: jqgrid jqgrid-asp.net jqgrid-formatter