Discussion:
How to add css class to list item in qx mobile?
(too old to reply)
Tomás Antunes
2016-03-30 15:45:09 UTC
Permalink
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
}
});
SQville
2016-04-01 15:36:04 UTC
Permalink
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



--
View this message in context: http://qooxdoo.678.n2.nabble.com/How-to-add-css-class-to-list-item-in-qx-mobile-tp7588223p7588233.html
Sent from the qooxdoo mailing list archive at Nabble.com.

Loading...