I need to load columns to Jqgrid Dynamically and am trying to follow jqGrid and dynamic column binding
Am trying in MVC. for Column name am fetching from Table(Which has a list of Columns to be displayed in GRID) and returning the Json data which is straightforward.
How do i implement for ColModel. For ex: i need to send JSon object like this dynamically
{name: 'Airport', formatter: UrlFmatter, width: 95, align: "center", index: 'AIRPORT', searchoptions: { sopt: ['eq', 'ne', 'cn']} }
{name: 'Country', width: 100, align: "center", index: 'Country', searchoptions: { sopt: ['eq', 'ne', 'cn']} }
How my design should be to send json to set the colModel ?
My UrlFmatter code
function UrlFmatter(cellvalue, options, rowObject) {
return "<a href='DetailResult?airportname=" + options.rowId + "' >" + cellvalue + "</a>";
}
How do i write as per your answer for formatting and unformatting ? Thanks