tags:

views:

389

answers:

1

I just need to rename JQgrid column dynamically as per user selection from a list of options. How can I do that?

A: 

According to the jqGrid Documentation, colNames cannot be changed after the grid is created.

However, you might be able to simulate a column name change by using several columns. Then you can hide all of them except a single one which will be shown to the user. When the user selects another, just swap in the selected column. For example, if valid columns are [A, B, C, D] you might start by only showing A. Then if the user chooses C, hide A and show C. The main disadvantage to this approach is that you will need to copy the same data to many columns, however.

Justin Ethier