Author Topic: colModel reorder  (Read 3093 times)

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
colModel reorder
« on: October 24, 2016, 02:39:44 am »
Im using splice to reorder the colModel and need to update the new colModel to the show / hide column feature...
Whats the best approach to do this?

Thanks.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: colModel reorder
« Reply #1 on: October 24, 2016, 07:25:45 am »
It's already answered in this post:

http://paramquery.com/forum/index.php?topic=1780.0

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Re: colModel reorder
« Reply #2 on: November 15, 2016, 07:31:13 pm »
Thanks, but when for example hide attribute is set on a column with:

Code: [Select]
colModel[0].hidden = true;
The checkboxes are still there (in columnselector) even though column is hidden...so it need to be updated...

Code: [Select]
grid.option( 'colModel', grid.option( 'colModel') );
grid.refresh();

doesn't seem to update that?


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: colModel reorder
« Reply #3 on: November 15, 2016, 08:49:27 pm »
grid API doesn't affect the column selector( which is a select list in the toolbar)

It's the other way around in this example, http://paramquery.com/pro/demos/showhide_groups

when a option ( corresponding to column ) in select list is checked/ unchecked by the user, grid API is used from toolbar listener to hide / show the columns.
« Last Edit: November 15, 2016, 09:34:30 pm by paramquery »

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Re: colModel reorder
« Reply #4 on: November 25, 2016, 07:29:16 pm »
Thanks, but when I change the hidden attribute dynamically...can I update the checkbox in the columnSelector? (The other way around?)


queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Re: colModel reorder
« Reply #5 on: December 04, 2016, 05:54:54 pm »
Would this be possible?
Thanks.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: colModel reorder
« Reply #6 on: December 05, 2016, 06:09:26 pm »
It can be done by setting value of select list followed by refreshData() method of pqSelect as answered here.

http://paramquery.com/forum/index.php?topic=1853.0