loadedRows handler not called and problem with getting rows from grid object

Posted by: steen.l.knudsen on 26 October 2022, 7:19 pm EST

  • Posted 26 October 2022, 7:19 pm EST - Updated 26 October 2022, 8:21 pm EST

    I have 2 problems with the code I have attached :

    • loadedRows handler not called
    • problem with getting rows from grid object. (I have to use var gridControl = theGrid[“$WJ-CTRL”]; to get the grid object with rows property)

    [code]

    [zip filename="JsFlexGridWeb1.zip"]disc-file-497e064d-b98c-4e73-9ed6-42032c5650bb.zip[/zip][/code]
  • Posted 27 October 2022, 11:00 pm EST

    Hi,

    1. We are able to replicate your issue on our end, this is an unexpected behavior for the ‘loadingRows’ and ‘loadedRows’ event so, this issue has been forwarded to the dev team for further investigation with internal tracking id WJM-25181. Meanwhile, to avoid this issue, you can define the ‘loadedRows’ and ‘loadingRows’ event handler before initializing the ‘itemSource’ property of the grid.

    Please find attached a sample for the same https://stackblitz.com/edit/js-oa8qey?file=index.js

    1. According to the code you have attached, this issue was occuring because ‘theGrid’(in init method) is private variable to ‘init’ method and it can not be accessed outside the init method. As the ‘debugconsole’ method is defined outside the init function, it can not access ‘theGrid’ variable. However, in your .html file, the host element for the flexGrid have ‘id = “theGrid”’, thats why when you use ‘theGrid’ variable in ‘debugconsole’ method it represents the flexGrid ‘hostElement’ not the flexGrid’s object and hence the issue occurs.

    Regards

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels