Author Topic: Drag&Drop when two grids are overlayed.  (Read 2790 times)

kiwon34

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 52
    • View Profile
Drag&Drop when two grids are overlayed.
« on: June 27, 2019, 10:43:50 am »
Hello,

I was testing drag&drop from 'https://paramquery.com/pro/demos/dnd_grids' demo.

I have changed javascript and html a little as below.
Javascript
//first grid.
        $("#dndgrid1").pqGrid({
            height: 500,     
            width: '45%',     
            colModel: $.extend(true, [], columns),
            dataModel: $.extend(true, {}, dataModel),
            complete: function () {
                this.flex();
            },
            dragModel:{
                on: true,
                //clsDnD: 'dnd1', <-- Annotation
                diHelper:['OrderID']
            },
            dropModel:{
                on: true,
               // accept: '.dnd2'  <-- Annotation             
            },
            //pageModel: { type: 'local', rPP: 20, rPPOptions: [1, 10, 20, 30, 40, 50, 100] },                                   
            title: "Shipping Orders"           
        });   
       
        //2nd grid
        $("#dndgrid2").pqGrid({
            height: 500,     
            width: '45%',     
            colModel: $.extend(true, [], columns),
            dataModel: $.extend(true, {}, dataModel),
            complete: function () {
                this.flex();
            },
            dragModel:{
                on: true,
                //clsDnD: 'dnd2',   <-- Annotation
                diHelper:['OrderID']
            },
            dropModel:{
                on: true,
                //accept: '.dnd1'    <-- Annotation
            },
            //pageModel: { type: 'local', rPP: 20, rPPOptions: [1, 10, 20, 30, 40, 50, 100] },                                   
            title: "Shipping Orders"           
        });       
HTML
<div id="dndgrid1" style="margin:auto;float:left;"></div>
    <div style="margin:auto;width:10%;float:left;">&nbsp;</div>
    <div id="dndgrid2" style="margin:auto;float:left;left:-10%;"></div>
    <div style="clear:left;"></div>

Now two grids are overlayed.

When I drag&drop in the right grid to switch rows, that row is also added to the left grid's tow row.
I don't know what makes the effect to the other grid when they are overlay.

Is there some option to prevent that?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6282
    • View Profile
Re: Drag&Drop when two grids are overlayed.
« Reply #1 on: June 27, 2019, 11:52:15 am »
What's your use case. Please mention exactly are you trying to do.

kiwon34

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 52
    • View Profile
Re: Drag&Drop when two grids are overlayed.
« Reply #2 on: June 27, 2019, 01:04:31 pm »
I have attached two pictures.

I want to make the right grid not affect the left grid as the pictures.

It works fine when the two grids are separately placed.
I want to know when two grids or more are placed like the picture, how to make them not effect each other when drag&drop.

Refer to attached 1.png and 2.png.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6282
    • View Profile
Re: Drag&Drop when two grids are overlayed.
« Reply #3 on: June 27, 2019, 05:29:36 pm »
Ok, I understand your concern.

Drag & drop doesn't work correctly in overlay mode, it's not supported.

kiwon34

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 52
    • View Profile
Re: Drag&Drop when two grids are overlayed.
« Reply #4 on: June 28, 2019, 05:55:28 am »
Do you have any plan on fixing this problem?