PDA

View Full Version : Replace Disclosure Icon with Delete Button on onItemDisclosure



BlackBook
14 Jun 2011, 8:31 PM
I have a list with with disclosure icons. When a user taps a disclosure icon, i want that icon to be replaced with a delete button.

How can this be accomplished?

msuresh
14 Jun 2011, 9:27 PM
You can capture the ontap event and replace, just search for it in API or some examples...

BlackBook
14 Jun 2011, 9:33 PM
You can capture the ontap event and replace, just search for it in API or some examples...

How can the replace part be implemented? Can you provide a sample code Sir? :)

bclinton
14 Jun 2011, 10:48 PM
You get a reference to the item in the itemtap event:


itemtap : ( Ext.DataView this, Number index, Ext.Element item, Ext.EventObject e )

You can then get the disclosure div element like this:


var el = Ext.get(item);
var disclosure_div = el.select('div.x-list-disclosure').elements[0];
var disclosure_element = Ext.get(disclosure_div);

epiphanydigital
3 Oct 2011, 7:53 AM
Is there no way to do this through configuration? Seems like that would make the most sense... ui: 'trash' or something to that effect.

Edit: I don't want to change the icon on tap, I just want the default icon to be different from the start.