JqGrid学习总结11——下拉框DataEven…时间:2021-11-09 03:28:361、当jqgrid的edittype=select,点击下拉框的值联动效果dataEvents,即change,click,keyPress事件 实例如下: varcolorSelect=“(255,0,0):red,(255,128,0):orange,(255,255,0):yellow”, {name:'id',index:'id',key:true} {name: 'disPlaycolor',width :30, index : 'name',edittype:'select',formatter:'select',editoptions:{value:colorSelect, dataEvents: [ {type: 'change', fn:function(e) { rowId=$(e.target).closest("tr:jqgrid").attr("id");//通过事件获得行ID $(this).val();//这可以去到当前单元格的值 }} // { type: 'click', fn:function(e) {} }, // { type:'keypress', fn:function(e) {} }]}