Topic
  • 3 replies
  • Latest Post - ‏2012-11-06T14:24:48Z by SystemAdmin
SystemAdmin
SystemAdmin
2327 Posts

Pinned topic dojox.mobile.EdgeToEdgeList

‏2012-10-01T10:35:45Z |
Hi,

There is only one label property availble to display the item name text.
Since the ListItem can be written as "li" tag, we can put any type or number of html tags to display the item text inside "li" tag, but this is not possible when adding list items programmatically using Dojo library after fetching data from database.
e.g.
var list1 = dijit.registry.byId("listname");
var item1 = new dojox.mobile.ListItem({ label: "Item 1" });
item1.placeAt(list1.containerNode);

Regards,
Zaheer Ijaz
  • Eric Durocher
    Eric Durocher
    38 Posts

    Re: dojox.mobile.EdgeToEdgeList

    ‏2012-10-02T09:54:39Z  
    Hi,

    You can set any HTML as the value of the "label" property, for example:

    var item1 = new dojox.mobile.ListItem({ label: "<p>Line1</p><p>Line 2</p>", variableHeight: true });

    (make sure to set variableHeight: true on either the ListItem or the parent list, otherwise the height of items is fixed by the CSS).

    Regards,

    Eric
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: dojox.mobile.EdgeToEdgeList

    ‏2012-10-02T11:20:59Z  
    Hi,

    You can set any HTML as the value of the "label" property, for example:

    var item1 = new dojox.mobile.ListItem({ label: "<p>Line1</p><p>Line 2</p>", variableHeight: true });

    (make sure to set variableHeight: true on either the ListItem or the parent list, otherwise the height of items is fixed by the CSS).

    Regards,

    Eric
    Thanks Eric, it works.

    Regards,
    Zaheer Ijaz
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: dojox.mobile.EdgeToEdgeList

    ‏2012-11-06T14:24:48Z  
    Thanks Eric, it works.

    Regards,
    Zaheer Ijaz
    Hi,

    I am using the bellow code to insert items into list,but its not showing the list.Could you please help me out.

    Bellow is the html code for the list container declaration.

    Bellow is the java script function to insert the list items.
    function loadList(){
    var list1 = dijit.byId("testList");

    for(var i = 0; i <3; i++){

    var item1 = new dojox.mobile.ListItem({

    label: "Data"

    });

    item1.placeAt(list1.containerNode);

    }
    }

    Waiting for reply,
    Harinadh