jquery - How can I access the cell object from within the custom formatter? -
i need cell object (not cell value) customer formatter.
what trying place 1 of superfish menus next cell need access cell jquery.
at moment have derived row index , column index inside formatter need access current cell jquery.
after further analysis generated code, seems there's no id set table cell in jqgrid.
i feel should able using rowobject parameter efforts failed far.
below simplified code:
function viewcolumnformatter(cellvalue, options, rowobject) { if (cellvalue == undefined || cellvalue == "") return ""; if (options.colmodel.commandcount > 1) { // here, need access cellobject... // know options.rowid , options.pos // need access cell "object" } } how can access cell object within custom formatter?
you can inject html using custom formatter.
if use custom formatter xml datatype rowobject parameter object represented dom element of corresponding row of xml input. type of rowobject ixmldomelement. find contain of corresponding child element correspond of column 'mycolumn' can use example
$(rowobject).find('mycolumn') if use loadonce:true jqgrid parameter, @ first load rowobject parameter dom element , @ later named javascript object , data need accessed rowobject.mycolumn
see question
Comments
Post a Comment