Author Topic: Column header groups - how to prevent nesting?  (Read 2069 times)

rickpqu

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 26
    • View Profile
Column header groups - how to prevent nesting?
« on: February 17, 2019, 11:30:26 pm »
I have 2-level column headers grouped into several groups. I found that I can drag a column group into another column group's second level, which results in 3-level column headers. For example, column group G1 with columns C1 and C2, and column group G2 with columns C3 and C4. If I drag G2 next to C1, then the result is

G1
C1 G3      C2
     C3 C4

Is there a way to prevent this group-into-another-group drag? I still want to allow group-next-to-another-group and column-next-to-another-column drags.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Column header groups - how to prevent nesting?
« Reply #1 on: February 18, 2019, 10:05:46 pm »
Dragged column can be checked in columnDrag event and nodrop property can be applied to columns of other level.

https://paramquery.com/pro/api#event-columnDrag

https://paramquery.com/pro/api#option-column-nodrop

rickpqu

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Column header groups - how to prevent nesting?
« Reply #2 on: February 27, 2019, 01:37:48 am »
Thanks. I see that columnDrag is triggered when I begin to drag a column. In my project, the decision to prevent the drop of a column is made when the column is dropped, based on whether the drop point is the first row of the column header or the second row. How can I handle this situation?