Flexgrid is Ready

Posted by: hoang.nguyen on 6 December 2017, 11:15 am EST

    • Post Options:
    • Link

    Posted 6 December 2017, 11:15 am EST

    Which event/property on Flexgrid will indicate that data binding, loadedRoes and formatItem are completed so user can begin to use the grid. The issue I have is:

    I load a form to display message “Data loading, please wait” when starting the app.

    After loaded json data from subscribing to a data provider into dataCollectionView. my Flexgrid will need to perform tasks through initialized, loadedRows and formatItem then pop the loading dialog off. I cannot find a good spot in my code to pop this dialog off. If call in getData() or loadedRows function, it will pop off too soon because formatItem is not yet completed. I cannot call this pop off dialog routine inside formatItem because it may trigger several times during app is running. I have tried to call it from itemsSourceChanged but it still pops off too soon? my question is: Do you have a way to tell when the grid is fully loaded and ready for using? thank you very much.

  • Posted 7 December 2017, 7:46 am EST

    Hi Hoang,

    The loadedRows event should be suitable for your requirement. The desired action should be call at the end of loadedRows event.

    ~Manish

  • Posted 7 December 2017, 10:40 am EST

    I did try loadedRows before posting this question sir. If you load a small amount of data, it is working fine. If I load a large chunk of data, loadedRows completed while formatItem is still executing. If I place the pop off routine inside formatItem, it will be called several times during and after data loading. Is there another method sir?

  • Posted 8 December 2017, 1:02 am EST

    Hi Hoang,

    Please try with using a flag variable which value should be true in intialized event and should be set to false in formatItem event after hiding required loader.

    If the issue persists, please share an demo sample depicting your issue for investigation.

    ~Manish

  • Posted 8 December 2017, 10:41 am EST

    The question is when to set this boolean variable to false inside formatItem because formatItem may start as soon as loadedRows started and may last much longer after loadedRows ended. Can you advice me sir? Thank you sir very much.

  • Posted 11 December 2017, 3:22 am EST

    Hi Hoang,

    As suggested initially, you can hide Form from loadedRows event since formatItem event gets triggered for view item in FlexGrid.

    formatItem in FlexGrid gets triggered as you make some changes in FlexGrid e.g scrolling, resizing or editing.

    Hence, the loadedRows event should be ok for this.

    If you would like to hide form from formatItem event, it should be called at the end of the code.

    Alternatively, you can also try updatedView event for the same with condition flag set in loadedRows event.

    ~Manish

  • Posted 11 December 2017, 11:29 am EST

    Thank you Manish

Need extra support?

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

Learn More

Forum Channels