Cajus Pollmeier schrieb:
> Fabian Jakobs schrieb:
>   
>> Hi Cajus,
>>     
>>> Hi again ;-)
>>>
>>> I've played with a List for a while now, which
>>> has a remove (edit, whatever) button after each
>>> list item. Lets call it SpecialList.
>>>
>>> The remove button is iniside the SpecialListItem
>>> and is part of the list. Until now, I didn't manage
>>> firering an event to allow the controller to act
>>> on this event. Since I learned about selection
>>> managers and children handling in the last hours:
>>>
>>> Can someone draw the "path" for me to walk?
>>>   
>>>       
>> I don't really get it yet. What exactly are trying to do? Maybe a small 
>> code snippet would help.
>>     
>
> Hi Fabian,
>
> maybe this ascii-art helps:
>
> ----------------------------------
> | Item 1         [Edit] [Delete] |
> | Item 2         [Edit] [Delete] |
> | ...                            |
> ----------------------------------
>
> This is a list of items, but it should be possible to
> remove or edit every item by an icon [...] in its own
> list entry.
>
> I could do this as some kind of scroll container and
> connect every button to some function, but I don't
> want to loose the capabilities of a list and its not
> that elegant. Since I'm relatively new to qooxdoo
> development, I was not able to find a way to let the
> list fire the events. Like i.e. "selected", I'd like
> to emit "delete" or "edit" in this case.
>
> More clear, or should I send some code? ;-)
>   
Its clear :-)

Using the List is perfect. This is how I would do it:

1. sub-class the List and define the event "delete" and "edit"
2. create the list item class with the buttons
3. add a 'parentList' property to the list item
4. add "execute" listeners to the buttons and dispatch "delete" and 
"edit" events on the "parentList". Use a data event and pass the clicked 
list item as argument:

  delButton.addListener("execute, function(e) {
    var parent = this.getParentList();
    if (parent) {
      parent.dispatchDataEvent("delete", this);
    }
  }, this);

5. override the list's "add" and "remove" methods. Set the "parentList" 
property of the incoming list item:

  add: function(item) {
   this.base(arguments, item);
   item.setParentList(this);
 }

6. Now you can listen on the List's "delete" and "edit" events.

I hope this helps,

Fabian


>   
>>> -
>>>
>>> One other question: is it possible to disable
>>> table headers?
>>>
>>> -
>>>
>>> Yeah - kind'a strange ideas, I know. But sometimes...
>>>   
>>>       
>> You can't really disable the header but you can try to give it a zero 
>> height. I haven't tried it myself but something like this should do it:
>>
>> var custom = {
>>     tablePaneHeader : function(obj) {
>>        var header = new qx.ui.table.pane.Header(obj);
>>        header.setHeight(0);
>>        header.setMaxHeight(0);
>>        return header;
>>     }
>> }
>>
>> var table = new qx.ui.table.Table(tableModel, custom);
>>     
>
> Ah, ok. I've tried it with directly setting the height of the header -
> not by defining a custom pane header... Will try it. Thanks!
>
> Cheers,
> Cajus
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>   


-- 
Fabian Jakobs
JavaScript Framework Developer

1&1 Internet AG - Web Technologies
Ernst-Frey-Straße 9 · DE-76135 Karlsruhe
Telefon: +49 721 91374-6784
[email protected]

Amtsgericht Montabaur / HRB 6484
Vorstände: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas 
Gottschlich, Robert Hoffmann, Markus Huhn, Hans-Henning Kettler, Dr. Oliver 
Mauss, Jan Oetjen
Aufsichtsratsvorsitzender: Michael Scheeren


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to