Author Topic: Setting dropModel by option fails  (Read 4161 times)

Autoflow

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 21
    • View Profile
Setting dropModel by option fails
« on: June 07, 2019, 07:32:59 pm »
Hi, just modified your example "Drag n Drop -> between grids" like this:

        //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',
                diHelper:['OrderID']
            },


            //dropModel:{
           //     on: true,
           //     accept: '.dnd1'               
           // },

            //pageModel: { type: 'local', rPP: 20, rPPOptions: [1, 10, 20, 30, 40, 50, 100] },                                   
            title: "Shipping Orders"           
        });
      
   $("#dndgrid2").pqGrid( "option", "dropModel", {
                on: true,
                accept: '.dnd1'               
            } );

Setting dropModel via option fails in this case.
Is this issue a bug?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6113
    • View Profile
Re: Setting dropModel by option fails
« Reply #1 on: June 07, 2019, 10:10:32 pm »
Setting dropModel after initialization is not supported.

Autoflow

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Setting dropModel by option fails
« Reply #2 on: June 08, 2019, 12:55:24 am »
Damn, OK.

I bought a PRO license today.
Is there any way to get this feature running, ie. by taking Tech support credits?
(If it is technically not possible just tell me too)

Best regards.
« Last Edit: June 08, 2019, 01:42:23 am by Autoflow »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6113
    • View Profile
Re: Setting dropModel by option fails
« Reply #3 on: June 10, 2019, 07:38:33 pm »
It's technically possible but it adds bit complexity and bloat to the source code for rarely required feature.

You could do it by destroying and recreating the grid with addition of dropModel. Please let me whether it works for you.

Autoflow

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Setting dropModel by option fails
« Reply #4 on: June 14, 2019, 03:45:11 pm »
I adapted my workflow to a select/paste based approach. Fits very well :-)

Allow me  a node beside:
DnD has issues when dropping rows within a nested grid (detailModel).
Dropped rows are then added to parent grid too.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6113
    • View Profile
Re: Setting dropModel by option fails
« Reply #5 on: June 14, 2019, 04:45:07 pm »
Could you please share a jsfiddle / plnkr for the mentioned DnD issue in a nested grid so that I can check it.