#12218 closed defect (fixed)
[patch][ccla] dojox.mobile.ScrollableView cannot be created dynamically
Reported by: | zhangyp | Owned by: | Jared Jurkiewicz |
---|---|---|---|
Priority: | high | Milestone: | 1.6 |
Component: | DojoX Mobile | Version: | 1.6.0b1 |
Keywords: | Cc: | Jared Jurkiewicz | |
Blocked By: | Blocking: |
Description
Current buildRendering logic in scrollable view assume that the scrollable view is created and initialized according to html template.
When we create scrollable view by var view = new dojox.mobile.ScrollableView?({id:"view"}); Line 41 of ScrollableView?.js for(i = 0, idx = 0, len = this.srcNodeRef.childNodes.length; i < len; i++){ will report error because this.srcNodeRef is null
Digging into this issue, I found other problems when creating scrollable view dynamically. For example, at Line 61 of ScrollableView?.js for(i = 0, len = this.domNode.parentNode.childNodes.length; i < len; i++){ this.domNode.parentNode is undefined when creating dynamically. After creating the view, if we call addChild to add footer or header, it will be added to containerNode instead of the domNode which is the expected node according to buildRendering logic. (I guess there should be specific methods to add footer and header in scrollable view)
All these problems lead to one question, do we support to create scrollable view dynamically? If not, we need to document the reason (For example, fast initialization or etc. ) and notify the users about the expected way to use it.
Attachments (1)
Change History (9)
comment:1 Changed 10 years ago by
Component: | General → DojoX Mobile |
---|---|
Owner: | changed from anonymous to Shane O'Sullivan |
comment:2 Changed 10 years ago by
comment:3 Changed 10 years ago by
zhangyp was correct. srcNodeRef should not be referenced, and addChild should be implemented to support fixed bars. Things were actually a little more complex because there are two types of fixed bars, view local bars and application bars. I fixed those problems and added two sample code test_dynamic-ScrollableView-vh-vf.html and test_dynamic-ScrollableView-ah-af.html. The former is for view local bar example, the latter is for application bar example.
comment:4 Changed 10 years ago by
Summary: | dojox.mobile.ScrollableView cannot be created dynamically → [patch][ccla] dojox.mobile.ScrollableView cannot be created dynamically |
---|
patch verified by zhangyp
comment:5 Changed 10 years ago by
Cc: | Jared Jurkiewicz added |
---|
comment:6 Changed 10 years ago by
Owner: | changed from Shane O'Sullivan to Jared Jurkiewicz |
---|
comment:7 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:8 Changed 10 years ago by
Milestone: | tbd → 1.6 |
---|
bulk update: bugs fixed in past few months, presumably milestone is 1.6
I'll take a look.