Author Topic: colModel.editor init function issue  (Read 1493 times)

ralph1996

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 80
    • View Profile
colModel.editor init function issue
« on: September 03, 2020, 03:53:10 am »
This is again something that has changed since earlier versions (4.0 and prior) but does pose an issue in the current version for handling custom controls in grid editors.

We are using jquery.multiselect library to enhance the dropdowns in a grid.  We initialize the library on the existing select element during the init callback for the editor.  In earlier versions (Pre 5.0) the init callback was called after the select element was moved into the appropriate cell. In 5.0+ the position is not updated until the EditorBeginDone event is triggered.  As far as I can tell this event is undocumented.  What this means is that if we continue to use the init function then initializing the custom dropdown positions it below the grid where the original select element is positioned.  The position update for the select ends up having no effect on the custom dropdown.

Ideally there would be a specific editor callback for "initDone" to allow adorning a custom control after pqGrid has performed its editor initialization.

We have worked around this by attaching to the EditorBeginDone event and performing the custom control initialization at that time.  But this is a shortcoming based on the documentation which specifically states the init function is used for initializing custom editors.  The problem is that it is now called too early.  Separating into an init callback and an initDone callback could solve the issue.

I am not thrilled with our workaround since it relies on an event that is not documented in the API.