I've got a working jqGrid to which I need to add a column based on the result of a javascript function. The column will just include an href link directing to another page.
Is it possible to add a column this way when creating the jqGrid or would I have to create a whole new grid with the new column if the function evaluates to true?
I've tried...
$('grid').jqGrid({
...
colNames: [..., (myFunction() == 'Value') ? 'Test' : null ],
colModel: [..., (myFunction() == 'Value') ?
{ key: true, name: 'Test', formatter: myFormatter, editable: false, align: 'center' } : null ],
...
but to no avail.
Would appreciate any help, thanks!