Results 1 to 2 of 2

Thread: How to add action to back-button in NestedList?

  1. #1
    Sencha User
    Join Date
    Dec 2010
    Posts
    3

    Default How to add action to back-button in NestedList?

    Hello,
    I want to ask if I can add a custom action to back button in nested list.
    I have eq. method:
    Code:
    var showDefaultMap = function(btn, event) {
       defaultMap();                         
    };
    And I have also a NestedList. Can I add this defaultMap function to the back button in NestedList??

    Or can I set for each level of NestedList a different function?

    And my last question Is there a function that returns NestedList to the root?


    Thanks a lot guys And happy Sencha Touch developing.

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2008
    Posts
    710

    Default

    The NestedList Control is nothing more than a card layout with toolbars and lists as the the cards. So, you can add listeners to the NestedList and perform actions as needed. You could probably use the itemtap or beforecardswitch event to stop the current event and perform your own actions.

    So something like this:
    Code:
                       xtype: 'nestedlist',
                       .... 
                       listeners: {
                            itemTap: function(list, index, item, e ) {
                                // Probably best to use this event to stop the current event and do
                                // your own custom code here, like check the event source to see if the
                                // back button was pressed, then go somewhere else.
                            }
                            beforecardswitch: function (cont, newCard, oldCard, index, anim) {
                                // Could possibly use this event as well.
                            }
                        }
    Hopefully that points you in somewhat of a better direction.

Similar Threads

  1. Button UI: Combine x-button-small with x-button-back and x-button-action
    By Benjamin Ansbach in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 21 Feb 2013, 2:05 PM
  2. [FIXED] [124] NestedList leaf card title and back button
    By supermonchi in forum Sencha Touch 1.x: Bugs
    Replies: 11
    Last Post: 11 Nov 2011, 4:27 AM
  3. How do I add a back button to a NestedList?
    By pwayner in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 18 Jan 2011, 11:32 AM
  4. [OPEN] [CLOSED-184] Nestedlist breaking on back button click
    By blessan in forum Sencha Touch 1.x: Bugs
    Replies: 12
    Last Post: 6 Sep 2010, 12:34 PM
  5. Nestedlist back button breaks after setCard method us used.
    By blessan in forum Sencha Touch 1.x: Discussion
    Replies: 3
    Last Post: 11 Aug 2010, 3:45 AM

Posting Permissions

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