Titanium Community Questions & Answer Archive

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

ANDROID: tableview addEventListener('click', function(e) is undefined

The following works great on the iphone and USE TO work on android with a lesser version of the Ti API, but the latest 1.4.2 doesn't seem to work.

dateRangeTableLo.addEventListener('click', function(e)
    {
        var index = e.index;
        var section = e.section;

        // reset checks
        for (var i=0;i<section.rows.length;i++)
        {
            section.rows[i].hasCheck = false;
            section.rows[i].color = '#fff';
        }
        // set current check
        section.rows[index].hasCheck = true;
        section.rows[index].color = '#33cc00';

    });

I tried to debug the value of 'section' by using this method mentioned in these boards.

try {
  dumpObj2(section,true, true);
catch(e){
  debug(section);
}

But the result was:
[INFO] [2020,6892] [object] thinks it's a [object TiUITableViewSection]
[INFO] [3,6895] The constructor of [object] thinks it's a/an undefined
[INFO] [193,7088] No Dynamic Properties

Any ideas whats going on here?

— asked November 16th 2010 by Dave F
  • addeventlistener
  • android
  • click
  • tableview
1 Comment
  • Would you provide a complete working script? Then I can test it in my environment and report back.

    — commented November 16th 2010 by Paul Dowsett

5 Answers

  • Accepted Answer

    Thanks Don, That did the trick, Quick question. which Android build is suggested for building against titanium? 2.2? or have you seen better success with 2.1?

    thanks

    — answered November 17th 2010 by Dave F
    permalink
    0 Comments
  • Please grab a CI build. The production 1.4.2 is exactly the same as 1.4.0 for Android. Sorry for the confusion.

    — answered November 17th 2010 by Don Thorp
    permalink
    0 Comments
  • Hey Don, Thanks for the reply. I'll give that a shot. Do you suggest I download the latest 1.4.3 build? or the 1.5.0 build?

    Thanks,

    Dave

    — answered November 17th 2010 by Dave F
    permalink
    0 Comments
  • Start with 1.4.3. 1.5.0 is getting very stable but we're still changing a lot this week.

    — answered November 17th 2010 by Don Thorp
    permalink
    0 Comments
  • Great. Will do. thanks!

    Dave

    — answered November 17th 2010 by Dave F
    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.