I am trying to convert a plain old html table to a jqGrid. The old table has a column containing tags which are constructed using an unordered list and list items.
Here is an example (jsfiddle) of the table before and the jqGrid after.
In this example I am using a custom formatter which uses jQuery Templates to construct DOM elements and then the formatter returns the $.html() from the resulting DOM elements.
function getTagCellContents(cellvalue) {
var domitems=$("#jqgrid-tag-list-item").tmpl({tags: callvalue});
return domitems.html();
}
The problem I had with this is that whitespace included in the resulting html causes the rows to be too high. This also results in awkward "Title" attributes on the cells.
Does the jqGrid provide an API for inserting DOM objects directly into the cell rather than by returning text from the custom formatter? What is the best practice for placing customized html into a jqGrid cell?
<button onclick='doSomething()'>Click Me</button>
because mydoSomething()
is a private function and not accessible by HTML. Thanks! – Adown