www.webOShelp.net

Get the latest on:webOS Developers' RSS FeedwebOS Facebook page webOS Twitter Feed

List

Example:

In scene:

 

<div id="storyListWgt" x-mojo-element="List"></div>

In listTemplate file (optional; defines HTML template for list's container; if omitted, list items are added to scene with no container):


<div class="palm-list">#{listElements}</div>

In itemTemplate file (required; defines HTML template for list items):


<div class="palm-row" x-mojo-tap-highlight="momentary">
  <div id="storyTitle" class="listTitle truncating-text #{unReadStyle}">#{title}</div>
  <div id="storyText" class="listText truncating-text">#{text}</div>
</div>

In scene assistant:


StoryListAssistant.prototype.setup =  function() {

    //  Setup story list with standard news list templates.
    //
    this.controller.setupWidget("storyListWgt",
        this.storyAttr = {
            itemTemplate: "storyList/storyRowTemplate",
            listTemplate: "storyList/storyListTemplate",
            swipeToDelete: false,
            renderLimit: 40,
            reorderable: false
        },
        this.storyModel = {
            items: this.feed.stories
        }
    );

    this.controller.listen("storyListWgt", Mojo.Event.listTap,
      this.readStory.bindAsEventListener(this));
};

 

 

 

webOS UI Widget List