Hi Trung,
very detailed reply, thank you very much for your time and patience.
I'll try to put all this together in a custom widget as you advised and let
you know about results.
kindest regards,
nminhtrung wrote
> Hi slah,
>
> 1) In my opinion, why don't you try to gather all your widgets inside
> function "configureItem" into a custom widget.
> qx.Class.define("yourqxdproject.CustomListItem", {
> extend : qx.ui.core.Widget,
> construct : function() {
> this.base(arguments);
> var layout = new qx.ui.layout.HBox();
> this._setLayout(layout);
> this._add(this.getChildControl("label"));
> this._add(this.getChildControl("btnRes"));
> this._add(this.getChildControl("btnIgn"));
> },
>
> properties : {
> appearance : {
> refine : true,
> init : "listitem"
> }
> },
>
> members : {
> _createChildControlImpl : function(id, hash) {
> var control;
> switch(id) {
> case "label":
> control = new qx.ui.basic.Label("test");
> control.set({minWidth : 200, maxWidth : 200});
> break;
> case "btnRes":
> control = new qx.ui.form.Button("Resolve");
> control.addListener("execute", function(e){
> alert("resolve button clicked for
> incident");
> });
> break;
> case "btnIgn":
> control = new qx.ui.form.Button("Ignore");
> break;
> }
> return control || this.base(arguments, id);
> }
> }
> });
>
> And then, in your delegate, you can create your new custom list item and
> bind the label like this:
> var delegate = {
> createItem : function() {
> return new yourqxdproject.CustomListItem();
> },
>
> bindItem : function(controller, item, id) {
> var labelItem = item.getChildControl("label");
> controller.bindProperty("label", "value", null, labelItem, id);
> }
> };
>
> 2) The property "appearance" in class youqxdproject.CustomListItem will
> make itself selectable as you want.
> You can search in qooxdoo framework in appearance section for more detail
> of configuration of appearance "listitem"
>
> 3) After that, you can use this to trigger whenever seclection changes
> var list = new qx.ui.list.List(model);
> list.getSelection().push(model.getItem(0)); // Set the first item selected
> list.getSelection().addListener("change", function(e)
> {alert(e.getData());}, this);
>
>
> Sincerely thanks,
> Trung
--
View this message in context:
http://qooxdoo.678.n2.nabble.com/qx-ui-list-List-binding-how-to-tp7584983p7584989.html
Sent from the qooxdoo mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel