How to add css class to list item in qx mobile?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to add css class to list item in qx mobile?

Tomás Antunes
I'm trying to modify the appearance of a subset of items in a list using qx mobile.
How can I achieve this?

list.setDelegate({
    configureItem : function(item, data)
    {
         item.setTitle(data.title);
         item.getContent().addCssClass('my-class'); // no effect
     }
});



------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to add css class to list item in qx mobile?

SQville
Tomas,

I get my desired result by just simply using the "addCssClass" function on the item itself, rather than calling the "getContent" function first (see my code below).

If you are trying to style a subset of the list items then you will need to uniquely identify each item by placing something in the data variable and setting the row to a different class value based on the value in the data object.

/***** ALL STUDENTS LIST ******/
     
      var lstallstudents = new qx.ui.mobile.list.List({    
        configureItem : function(item, data, row)
        {
          item.setImage(data.image);
          item.setTitle(data.title);
          item.setShowArrow(true);
          item.getTitleWidget().addCssClass("utroverviewitemlabel");  
          item.addCssClass("utroverviewlist-item"); 
        },
       
        createItemRenderer: function() {
          return new rapp.component.CssEnhanced();
        }
      });

Chris
Loading...