Author Topic: Drag n Drop: function to evaluate drop rows  (Read 584 times)

mikep

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 15
    • View Profile
Drag n Drop: function to evaluate drop rows
« on: September 13, 2019, 01:05:34 am »
I need to disallow rows from being dropped into my main grid, based on conditions in the source grid column. If the 1st column in the dropped row from the source grid is not checked, I don't want the row added.

How would I update the below function to do this.


                drop: function (evt, uiDrop) {



                    //only add if the source column is checked
                    this.addNodes([node], isNaN(rowIndx) ? null : rowIndx);
                }


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 4315
    • View Profile
Re: Drag n Drop: function to evaluate drop rows
« Reply #1 on: September 13, 2019, 12:22:46 pm »
[ Only Pro members may read this post. ]

mikep

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Drag n Drop: function to evaluate drop rows
« Reply #2 on: September 13, 2019, 05:04:26 pm »
Thanks, that helps. Are there any examples demonstrating this, that I can work from?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 4315
    • View Profile
Re: Drag n Drop: function to evaluate drop rows
« Reply #3 on: September 13, 2019, 06:32:54 pm »
[ Only Pro members may read this post. ]

mikep

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Drag n Drop: function to evaluate drop rows
« Reply #4 on: September 30, 2019, 06:45:21 pm »
Thank you.

Another question. When a row is dragged onto another grid, is there a way to know which column the row is dropped onto in the target grid?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 4315
    • View Profile
Re: Drag n Drop: function to evaluate drop rows
« Reply #5 on: September 30, 2019, 07:05:07 pm »
[ Only Pro members may read this post. ]

mikep

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Drag n Drop: function to evaluate drop rows
« Reply #6 on: December 05, 2019, 08:46:54 pm »
How can I prevent the dragged item from being removed from it's source grid?
https://jsfiddle.net/gr9mq0es/

I've seen your code example of this, but I don't understand your code which implements this. so wanted to provide a more basic scenario.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 4315
    • View Profile
Re: Drag n Drop: function to evaluate drop rows
« Reply #7 on: December 06, 2019, 09:55:29 pm »
[ Only Pro members may read this post. ]