0

Am working on JQGrid and i got this doubt on how to implement.

Currently am displaying standard set of results to user every time as given in examples.

colNames:['Inv No no NO','Date', 'Client', 'Total in EUR']

Suppose if am changing this result set i will change in .js file (add or remove column) of JqGrid.

Is there a any way i can bring these Column names from Table and Bind it to JqGrid ?

Also how do i ADDcolumn names at runtime ? like adding new Column and all.

Thanks

user2067567
  • 3,695
  • 15
  • 49
  • 77

1 Answers1

0

Inside loadComplete() try the following code to change the column name dynamically to a value.

 $("#grid_id").jqGrid('setLabel',"column_name", 'new_label');

You can parse the colModel to get to the particular column you wish to change to do the same.

Ajo Koshy
  • 1,205
  • 2
  • 21
  • 33
  • am talking about bringing column names from DB and adding column not changing the Column text – user2067567 Mar 13 '13 at 08:54
  • 1
    Though can dynamically set the columns, you cannot add new columns if or when required if the grid already has a set of data – Ajo Koshy Mar 13 '13 at 08:57