1
的onSelectRow事件中的jqGrid不觸發在Chrome中我得到一個錯誤,當鼠標懸停在該行的jqGrid onSelectRow不工作
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.2.6和not1.5.2有衝突 – user1109203 2012-01-22 13:51:57