jqGrid onSelectRow Not Working
jqGrid onSelectRow Not Working
jqGrid中的onSelectRow事件在Chrome中未启动我将鼠标悬停在行上时出错
Uncaught TypeError: Object #<Object> has no method 'closest'
b.fn.jqGrid.each.b.before.click.Yjquery.jqGrid.min.js:113
jQuery.event.handlejquery-1.2.6.min.js:26
jQuery.event.add.handle
当我点击行时,我会得到这个错误
event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
jquery.jqGrid.min.js:113Uncaught TypeError: Object #<Object> has no method 'closest'
b.fn.jqGrid.each.b.before.click.bind.a.p.datatypejquery.jqGrid.min.js:113
jQuery.event.handlejquery-1.2.6.min.js:26
jQuery.event.add.handlejquery-1.2.6.min.js:25
jquery.jqGrid.min.js:113Uncaught TypeError: Object #<Object> has no method 'closest'
b.fn.jqGrid.each.b.before.click.Yjquery.jqGrid.min.js:113
jQuery.event.handlejquery-1.2.6.min.js:26
jQuery.event.add.handle
有什么帮助吗?请给我的代码
$('#PrimaryGrid').jqGrid({
datastr: GetJSON(),
datatype : 'jsonstring',
width:676,
colNames: ['Code', 'Description', 'Qty', 'Price','Total',''],
colModel:
[
{ name: 'Code', index: 'Code', width: 50, align: 'left', sortable: false },
{ name: 'Description', index: 'Description', width: 305, align: 'left', sortable: false },
{ name: 'Qty', index: 'Qty', width: 50, align: 'center', sortable: false },
{ name: 'Price', index: 'Price', width: 100, align: 'right', sortable: false },
{ name: 'Total', index: 'Total', width: 100, align: 'right', sortable: false },
{name:'subg',index:'subg', width:1,sortable:false},
],
rowNum: -1,
height: 'auto',
multiselect: false,
sortname: 'Qty',
sortorder: 'ASC',
subGrid: true,
loadonce: false,
gridComplete: function () {
var ids = $("#PrimaryGrid").getDataIDs();
for (var i = 0; i < ids.length; i++) {
if($("#PrimaryGrid").getRowData(i).subg == "false"){
$('tr#'+i, $("#PrimaryGrid"))
.children("td.sgcollapsed")
.html("")
.removeClass('ui-sgcollapsed sgcollapsed');
}
}
},
onSelectRow: function(id){
alert('Selected row ID ' + id);
},
caption: '<div style="width:630px;height:20px;">Items and Bills</div>'
});
我在使用jqGrid和jQuery 1.6.1时多次收到相同的错误,我升级到jQuery 1.7.1并停止收到此错误。正在尝试下载并使用最新版本的jQuery。
相关文章:
- $rootScope not working
- jQuery document.ready not working
- Javascript getElementsByTagName not working?
- JQuery.val( ) not working
- Tomcat websocket is not working
- Javascript JSON.parse not working
- NodeJS Multer is not working
- Regex not working
- Ember run.debounce not working
- AngularJs 1 not working
- document.getElementById.style.backgroundImage not working
- Rxjs5, distinct() is not working
- createOscillator noteOn not working
- Javascript - .getHours() not working
- Javascript setTimeout not working | onkeydown
- MongoDB $pull not working
- Express router.use not working
- JSONP not working
- window.opener not working in chrome & IE
- Backbone + RequireJS: Collection.each() is not working