murtaza sanjeliwala
murtaza sanjeliwala

Reputation: 205

How to change colNames and colModel dynamically in jqgrid?

I have to add/remove colNames and colModel of jqgrid dynamically not using hide/show without unload or destroy jqgrid. is it possible?

Upvotes: 0

Views: 453

Answers (1)

Oleg
Oleg

Reputation: 221997

Adding/removing columns isn't easy in case of all existing features of jqGrid, but I wrote addColumn method some years ago, which implements adding of columns dynamically (no removeColumn). To use the method you need to add the file jQuery.jqGrid.addColumn.js after jquery.jqgrid.min.js.

On the other side recreating of jqGrid isn't nice, but it works safe and quickly enough. Thus I recommend still to consider you to use GridUnload too.

Upvotes: 1

Related Questions