Results 1 to 4 of 4

Thread: DataView: viewready fired before elements available

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium User
    Join Date
    Apr 2015
    Location
    Germany
    Posts
    122

    Default DataView: viewready fired before elements available

    Ext version tested:
    • Ext 5.1.2



    Browser versions tested against:
    • Firefox 42.0
    • Chromium 46.0.2459.0



    DOCTYPE tested against:
    • strict



    Description:
    • API doc of viewready event in Ext.view.View says:
      Fires when the View's item elements representing Store items has been rendered.
      But the item elements are not ready there yet, when binding the store to the view (from ViewModel).



    Steps to reproduce the problem:
    • Use view with binded store.
    • listen to viewready event.



    The result that was expected:
    • Item elements available in event.



    The result that occurs instead:
    • Item elements not available in event.




    I want to add Ext.resizer.Resizer to the elements, so I need to wait until they are rendered to add a resizer to every element. Or is there a better way to make the items resizable?

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,253

    Default

    The docs are correct, with the caveat that "Fires when the View's item elements (if there are any) representing Store items has been rendered."

    When the first refresh of the view fires, the store is not yet bound so there are 0 items to display.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Sencha Premium User
    Join Date
    Apr 2015
    Location
    Germany
    Posts
    122

    Default

    Ok, calling view.getNodes() in refresh listener brought
    Code:
    TypeError: records[i] is undefined
    in fiddle. That's why output was broken and I thought it was the wrong event. Thank you.

  4. #4
    Sencha Premium Member
    Join Date
    Jun 2014
    Posts
    67

    Default

    Quote Originally Posted by evant View Post
    The docs are correct, with the caveat that "Fires when the View's item elements (if there are any) representing Store items has been rendered."

    When the first refresh of the view fires, the store is not yet bound so there are 0 items to display.
    Just to dig this one up again.

    I'm on ExtJS 6 and am not seeing viewready fired on update at all. Should it be?

Similar Threads

  1. using viewready event of dataview to modify dom
    By vgtejada in forum Ext: Q&A
    Replies: 1
    Last Post: 19 May 2014, 8:23 AM
  2. [FIXED] DataView itemtaphold event not fired
    By mvarshavsky in forum Sencha Touch 2.x: Bugs
    Replies: 6
    Last Post: 16 Jul 2012, 7:59 AM
  3. viewready is not getting fired
    By bee in forum Ext: Q&A
    Replies: 1
    Last Post: 3 Jan 2012, 1:36 AM
  4. resize event fired instead of onClick for Ext.Button elements
    By techakone in forum Ext 3.x: Help & Discussion
    Replies: 14
    Last Post: 16 Aug 2010, 6:27 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •