Author Topic: Question about dropping into a grouped grid  (Read 1876 times)

WynApse

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 17
    • View Profile
Question about dropping into a grouped grid
« on: November 15, 2019, 05:39:33 am »
I have requirements to drop onto a grid that has grouping turned on.

I have an ID field on the JSON data that feeds the grid, and when I drop, it matters which column(cell) I drop on.

To add to that fun, I further have a requirement to modify the JSON data.

The problem then becomes that not all the 'uiDrop.rowData' has the id column when things are grouped, so I can't sync my drop info with the JSON because I have no idea what record I'm dealing with.

If I try to turn off the grouping inside 'drop' -- uiDrop is already set and that ship sailed.

I can remove the grouping by hand and everything works because now I DO have the id field.

It would be very nice to have a 'dragbegin' event so that I could remove the grouping and a 'dragend' I suppose in case the user bails on the dnd so I can put the grouping back.

Any ideas around this?


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Question about dropping into a grouped grid
« Reply #1 on: November 15, 2019, 09:39:36 pm »
jQueryUI draggable API ( and hence drag start and stop events ) can be used for the grid with help of options sub-option of dragModel.

https://paramquery.com/pro/api#option-dragModel

https://api.jqueryui.com/draggable/#event-start

https://api.jqueryui.com/draggable/#event-stop

Code: [Select]
dragModel:{
                on: true,
                .......
options:{
start: function(evt, ui){

},
stop: function(evt, ui){

}                         
}
},
« Last Edit: November 15, 2019, 09:44:33 pm by paramvir »