Tag:null or noDom in enyo1

edited June 2012 in Enyo 1.0
In enyo 2 if you set tag:null to a control, the control do not create any HTML code but you can add child controls to it. Is there a way to get the same behaviour in enyo1?


  • edited June 2012
    That's what enyo.Component is for: http://enyojs.com/api/#enyo.Component

    EDIT: I may be mistaken, if you mean to still allow children to render, try setting 'nodeTag' to null in the same way as with 'tag' in enyo 2
  • The tag: null thing was an idea added during the development of Enyo 2. AFAIK, there's no similar support in Enyo 1.
  • Interesting, are there any limitations? For example, can you still apply CSS to the root control?
  • In Enyo 2, when tag is null, no content is generated for that node, only it's children are generated. So, if you set style or classes, they would do nothing since there's no node for them to apply to.

    This was added to handle cases like enyo.Repeater where we need a phantom node for namespacing of each repeater item instance, but don't want it showing up in the render.
  • Yes thats exacly where I encountered the problem. I'm trying to port the 2.0 list to Enyo v1 ATM. Thanks for your clarification.
  • Do post back once you've finished porting (or if you need any assistance). A lot of people, including myself, will benefit from it being ported!
  • you can grab it there https://www.dropbox.com/s/tn5e98fgh9iv681/list.zip.

    There is a bug: If you don't select the first line first (let's say the 3 line for example) and then you select another line (let's say the second line) then the first line get updated....

    I tried to chase this bug for hours. Any help would be appreciated!
  • Sure, I'll devote some time to it during this week and see if I can produce a fix. Thanks for sharing :-)
  • edited June 2012
    To get a similar effect you may need to override generateHtml or related methods.

    Something like generateHtml: function() { return this.getInnerHtml(); } which would in theory (haven't tried it) just return the child HTML without adding any tag of its own.
  • Ok after hours of debugging I finally found it (as usual it was as simple as adding one line at the right palce...). The updated version of the enyo2 list control for enyo 1 is here:

    I don't have any github account but feel free to share it on github if you want.

    Also I only tested it on my HTC device. If someone could test it on other devices it would be really helpful.

    (note swipeableItem is not working now.
  • If I make any changes I'll make a git for it, but I'll give you credit and link back. Also I'll test later on my Archos tab. It has terrible spec which makes it (only) good for testing performance.

    (Also, I barely ever use SwipeableItem because it interferes with horizontal scrolling - it's easy enough for most people to switch to a popup/dropdown menu too so it shouldn't be a big problem.)
  • One UI pattern that I really like on Windows Phone is that tapping on the right edge of a list item causes it to enter multi-select mode where checkboxes appear by each item, If you unselect all, it leaves that mode, but while one or more are selected, UI choices appear to do an action on all of them. It feels a lot faster and easier to use than the multiselect that was in Enyo 1 lists (for the email app, for example), although it might not work on lists that aren't "screen-wide" where you naturally tap in the middle.
  • I hadn't noticed that; which app(s) in particular use it?
  • Email app is the big one that does this on Windows Phone, but it also works in NextGen Reader.
  • Ah it works on the left edge for me, weird. Nice feature though, it would definitely look good in enyo.
  • ah, left is what I meant... I always get confused :)
  • It only really makes sense if your left-handed anyway. I'm right-handed and I can reach all the way up the right side with my thumb but can't reach the top of the left side which is a bit annoying. If I have a go at implementing it in enyo I'll do it for the right side initially.
  • left or right - what's the difference? it should be just an option.
  • yeah, that's what I mean when I say I'd do it on the right initially. I'd still add a flag for switching to either side at some point.
Sign In or Register to comment.