Author Topic: columnSelector in detail grid (child)  (Read 2667 times)

TonyLeech

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
columnSelector in detail grid (child)
« on: January 17, 2017, 01:14:56 am »
I'm using the pqSelect style column selector in a child grid the same as I would for the mainGrid.  Each time the child grid is expanded the new class "detailcolumnSelector" works fine and the detail grid 'load' event sets up the entries and the pqSelect conversion.  My problem is that when I then open a second detail grid the first detailGrid loses the column options from the selector, and the second detail grid column Selector now works instead.  So every new details grid works fine, but the old and still open grids lose the column selector functionality.

I thought that as they all share the same class "detailcolumnSelector", and the fact they all share the same colModel structure as well, that all instances of the class would act simultaneously...but instead only the latest opened detailGrid operates correctly whilst the old ones stop working.

I don't know if I've given you enough to work with here, but do you know if what I'm trying to do is even possible?  Do you have any samples of grids with rows of details grids that use the column selector within the details grids?

Many thanks in advance.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6312
    • View Profile
Re: columnSelector in detail grid (child)
« Reply #1 on: January 17, 2017, 07:40:23 am »
In the example, only one grid has "columnSelector" class, so $(".columnSelector") works fine.

But in case of detail grids, child grids share the same class "columnSelector", which causes the mentioned issue when selector $(".columnSelector") is used.

So replace $(".columnSelector") with more specific selector,

Code: [Select]
  grid.widget.find(".columnSelector");

TonyLeech

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
Re: columnSelector in detail grid (child)
« Reply #2 on: January 17, 2017, 03:19:52 pm »
Works perfectly.  Fantastic. Thanks.