Author Topic: Upgrade Issue - dropdown editor in wrong position  (Read 2451 times)

ralph1996

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 80
    • View Profile
Upgrade Issue - dropdown editor in wrong position
« on: August 31, 2020, 11:52:59 pm »
We are upgrading from version 3.4.  I decided the best approach is to do each version upgrade in sequence in order to isolate issues and fix them before moving on.  During the upgrade to 4.03 from 3.4 I am finding an issue with custom dropdown editors in a grid cell.  We are using the jQuery.MultiSelect dropdown library and it worked perfectly in 3.4.  I have stepped through the ParamQuery code and found the change that is causing the issue and need to know how to work around this.

The issue is that in 3.4 the refreshEditorPos function updated the position of the editor to be within the cell and is called from _generateCellRowOutline.  The same call occurs in 4.03, however the body of the refreshEditorPos function is empty. This causes the outline and effectively the contents of the button and dropdown to be displayed in the top left corner of the grid instead of in the cell itself.

The Upgrade guide did not mention anything about issues in this area and it is not mentioned in the breaking changes for version 4.

This code seems to have stayed the same for multiple version but in 7.3 _generateCellRowOutline no longer calls the function and the function has been removed entirely. 

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Upgrade Issue - dropdown editor in wrong position
« Reply #1 on: September 01, 2020, 04:38:37 pm »
Please note that pqgrid doesn't claim any support for jQuery.MultiSelect dropdown

That being said, however I don't see any issue with the positioning of jQuery.MultiSelect dropdown in the pqgrid editor as mentioned by you

Please check this stackblitz created with latest version of pqgrid:

https://stackblitz.com/edit/paramquery-demo-multiselect?file=index.js
« Last Edit: September 01, 2020, 06:56:51 pm by paramvir »

ralph1996

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 80
    • View Profile
Re: Upgrade Issue - dropdown editor in wrong position
« Reply #2 on: September 01, 2020, 10:05:01 pm »
The issue does not appear to be due to the multiselect integration.  The actual _generateCellRowOutline function is called well before initialization of multiselect.  The multiselect just loads where the object is located, which originally is in the wrong place as it does not get moved by refreshEditorPos.

It appears that in 7.3 all of this code has been replaced, so I will use my workaround (overriding refreshEditorPos) for now until I get to that version and see if the issue still exists.

Thanks

ralph1996

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 80
    • View Profile
Re: Upgrade Issue - dropdown editor in wrong position
« Reply #3 on: September 04, 2020, 09:36:17 pm »
The workaround mentioned above does not work in 7.3 as the code has been completely replaced along the way.

I have submitted a bug report regarding the behavior of the init property of the editor when using a custom editor in V5+.  I have also worked around that issue, but believe that the issue should be fixed/resolved so as not to require an undocumented workaround.


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Upgrade Issue - dropdown editor in wrong position
« Reply #4 on: September 04, 2020, 09:56:00 pm »
Please mention what issue are you facing in https://stackblitz.com/edit/paramquery-demo-multiselect?file=index.js

or share your own test case w.r.t use of published API only.

ralph1996

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 80
    • View Profile
Re: Upgrade Issue - dropdown editor in wrong position
« Reply #5 on: September 04, 2020, 10:12:29 pm »
IN your example if you add autoOpen = true to the multiselect initialization you will see the issue.

Code: [Select]
        editor: {
            type: 'select',
            init: function (ui) {
                ui.$cell.find("select").multiselect(
                      {header: "Select an option", autoOpen:true}
                    );
                /*setTimeout(function () {
                    ui.$cell.find("select").pqSelect('open');
                })*/
            },

I am only using the EditorBeginDone event to work around this problem since I could not find a documented solution.  See my detailed explanation here:

https://paramquery.com/forum/index.php?topic=3820.0

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Upgrade Issue - dropdown editor in wrong position
« Reply #6 on: September 04, 2020, 10:16:30 pm »
Noted, thanks