0

qx.ui.mobile.list.List seems not to support the qx.data.controller.List. Is there another way to add a delegate for createItem? I tried to add the create delegation on both classes, but createItem was not invoked.

Niels Steenbeek
  • 4,692
  • 2
  • 41
  • 50

1 Answers1

0

Here is an example, how to use databinding with lists:

/**
 * Creates a list and returns it.
 */
__createListDataBindings : function() {
  var self = this;

  var list = new qx.ui.mobile.list.List({
  configureItem : function(item, data, row)
    {
      var stopCount = self.getListData().getLength()-row;
      item.setTitle("Stop #"+stopCount);
      item.setSubtitle(data);
    }
  });
  this.bind("listData", list, "model");

  return list;
},

ListData is a class property:

 properties :
  {
    // overridden
    listData :
    {
      init : new qx.data.Array(),
      nullable : true,
      event : "updateListData"
    }
  },
czuendorf
  • 853
  • 6
  • 9
  • I meant the createItem delegation mentioned on http://manual.qooxdoo.org/1.6/pages/data_binding/controller.html. But after looking into the code, I think it must be 'createItemRenderer' instead of 'createItem'. var delegate = { configureItem : function(item) { item.setPadding(3); }, createItemRenderer : function() { return new qx.ui.mobile.form.CheckBox(); }, };sdfsdf – Niels Steenbeek Feb 15 '13 at 10:20