0

I want to change my grid's colmodel dynamiclly and I did lots of search but non of the question thread answered me. I need to pivot a select in sql so after I execute my query I find out names and count of my grid's columns.

In other posts I find the way of changing the colmodel but I don`t know when and where I must do it. It is not possible to execute query two time becuase It may changed in result and decrease performance.

Hamid Mayeli
  • 805
  • 1
  • 14
  • 24
  • You are strongly encouraged to include what you have tried so far. It is always a good idea to include code that people can start of from. Stackoverflow is not a code-writing-service and people usually react sensitive to such questions. – lord.garbage Oct 20 '14 at 15:50

1 Answers1

0

One can use beforeProcessing callback to make many modifications in colModel dynamically. One can't add/remove columns and one can't modify name property, but the most other changes are allowed. I would recommend you to use setColProp method to make the modification. One can use setLabel to modify column headers. The answer, this one and the another one provides corresponding examples.

I am working now on addColumn/removeColumn column methods which will allow to modify colModel more deep. You can find the current beta version of addColumn with the corresponding demos on github.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798