Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

tableView, Swipe-to-delete and other events

Hi All,

I am trying to get a tableview with swipe to delete (editable=true) to display a label at the bottom of the screen when the editing mode is entered into (ie. prior to delete event).

Unfortunately I can't seem to catch any events to indicate that the table view has entered editing mode in order to launch the animation.

I have tried to catch 'swipe' but it never fires (even though the table enters editing mode).

I have caught 'touchend' but it does not fire at the end of a swipe only on other touch events.

Has anyone got any ideas?

Perhaps this is a bug with firing swipe or touchend at end of swipe in a table view.

TI folk, it might be an idea to have this scenario as own event type, 'editing' perhaps?

Cheers,

Nick.

— asked August 16th 2010 by Nick The Geek
  • editing
  • events
  • fire
  • mobile
  • tableview
  • touchend
0 Comments

1 Answer

  • My understanding is that 'touch' events only work on certain elements. They don't work on table views for example. However, they do work on scroll views.

    I haven't tried the swipe event on a table, but if it doesn't work, I've had a lot of success by attaching a table view to a scroll view. You will have to set a hard width and height for the table, thus you will need to know the number of rows in the table then multiply that times the height of each row, and be sure to add 1 to that height because of the border. Doing this gives you all the touch events you were expecting.

    As a caution, it's very fickle. But if you are determined, it will work the way you want.

    — answered April 13th 2011 by Joe iEntry
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.