Author Topic: How to Drag n drop columon by dianamic  (Read 1981 times)

sshede

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 41
    • View Profile
How to Drag n drop columon by dianamic
« on: August 20, 2021, 03:31:35 pm »
Hi,

How to Drag n drop column by dianamic.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6126
    • View Profile
Re: How to Drag n drop columon by dianamic
« Reply #1 on: August 24, 2021, 09:21:55 pm »
How do you mean by dynamic drag and drop. Could you please share some kind of use case or example.

sshede

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: How to Drag n drop columon by dianamic
« Reply #2 on: August 25, 2021, 10:27:03 am »
Hi,

I have one dropdown, this droptown call onchange function this function shift 2 colum to after 4th colum.

Thanks,
Sagar Shede

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6126
    • View Profile
Re: How to Drag n drop columon by dianamic
« Reply #3 on: August 25, 2021, 12:40:32 pm »
Please use Columns().move API

https://paramquery.com/pro/api#method-Columns

Code: [Select]
  //move 1 column from 2 index to 4 index.
  grid.Columns().move(1, 2, 4);

sshede

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: How to Drag n drop columon by dianamic
« Reply #4 on: August 25, 2021, 01:56:56 pm »
thanks for replay

sshede

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: How to Drag n drop columon by dianamic
« Reply #5 on: August 25, 2021, 07:35:50 pm »
Hi,

Below option have in  3.5 version .
grid.Columns().move(1, 2, 4);

Thanks,
Sagar Shede

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6126
    • View Profile
Re: How to Drag n drop columon by dianamic
« Reply #6 on: August 25, 2021, 08:53:28 pm »
It doesn't work in v3.5, it's supported since v7.1.0

sshede

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: How to Drag n drop columon by dianamic
« Reply #7 on: August 26, 2021, 12:23:04 pm »
any other way

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6126
    • View Profile
Re: How to Drag n drop columon by dianamic
« Reply #8 on: August 26, 2021, 03:36:07 pm »
colModel is a js array, so js array manipulation method "splice" can be used to rearrange the columns followed by call to refreshCM method.

https://paramquery.com/pro/api#method-refreshCM