Results 1 to 3 of 3

Thread: Custom handling for nestedList itemtap

  1. #1
    Touch Premium Member
    Join Date
    May 2011
    Posts
    38

    Default Custom handling for nestedList itemtap

    Hi,
    I'm trying to implement a NestedList so that when a non-leaf item is tapped, it does not switch the card (but implement custom handling), and when the selected non-leaf item is tapped again, that's when it will switch the card to the sublist.
    I found that I can return false on beforecardswitch to prevent it, but I don't have information about which item was tapped on beforecardswitch(nestedList, oldCard, newCard, index). This information is passed on itemtap, but the problem is that itemtap is fired after beforecardswitch. So I cannot make decision on beforecardswitch whether to return false or true.
    Doesn't it make more sense to fire beforecardswitch after itemtap? Or is there a good reason why the event firing is implemented in the current order?

    Current order are:
    beforecardswitch
    itemtap
    cardswitch

    I would expect it to be:
    itemtap
    beforecardswitch
    cardswitch

    Anyway with the way it works now, is there a way to accomplish what I want?

    Thanks,
    - reynard

  2. #2
    Touch Premium Member
    Join Date
    Feb 2011
    Posts
    33

    Default

    I call this function on cardswitch, not sure if this helps.

    You might try to suspendEvents and resumeEvents too?

    Code:
              updateLeafs: function(list){
                            var ai = this.getActiveItem().store.data.items;
                            for(var i=0; i<ai.length; i++){
                                if( ai[i].data.leaf ){
                                    console.log(ai[i].data.text + " is a leaf");
                                }
                            }
                        }

  3. #3
    Touch Premium Member
    Join Date
    May 2011
    Posts
    38

    Default

    Hi, thanks for the response!
    The problem is that cardswitch is triggered after the cardswitch happens, so it's too late to suspend events.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •