Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to distinguish the target back button in ST2?
    primarykey
    data
    text
    <p>I have a little problem here with Sencha Touch 2:</p> <p>My App has 2 views/lists: news and events. Both have detail views. On the news list Iam showing an filter and sort button and on the events list Iam want to show only the filter button.</p> <p>When I click on an item, the nav controller automatically adds an back button.</p> <p>What I do atm is: - when the user clicks an item in the list: hide all buttons - when the user clicks the back button: show all buttons</p> <p>And thats the problem... I cannot see if it was the back button on the news detail view or the events detail view.</p> <p>In my controller I have:</p> <pre><code>"mainnav[id=mainNav]": { back: 'showButtons', }, </code></pre> <p>when I try:</p> <pre><code>"panel[id=newsDetail]": { back: 'showButtons', }, </code></pre> <p>the event gets not triggered. So how can I know is it was the news or events back button?</p> <p>Thanks!</p> <p>Edit: Its not easy to explain... here is some more information: The "mainNav" is a navigation view and the back button gets added to its toolbar.</p> <pre><code>Ext.define('MyApp.view.MainNav', { extend: 'Ext.navigation.View', alias: 'widget.mainnav', config: { id: 'mainNav', maxWidth: '350px', items: [ { xtype: 'tabpanel', layout : { type : 'card' }, ... items: [ { xtype: 'list', title: 'News', id: 'newsList', store: 'newsStore', grouped: true, onItemDisclosure: true, ... { xtype: 'list', title: 'Events', iconCls: 'team', id: 'eventList', store: 'eventStore', onItemDisclosure: true, ... tabBar: { docked: 'bottom' } ... and the navigation bar with its buttons: navigationBar: { minWidth: '', width: '', id: 'navBar', layout: { align: 'center', type: 'hbox' }, items: [ { xtype: 'button', id: 'settingsButton', align: 'left', iconCls: 'settings6', iconMask: true }, { xtype: 'button', id: 'filterbutton', align: 'right', iconCls: 'list', iconMask: true } ] }, </code></pre> <p>What iam trying to do now:</p> <pre><code>"mainnav[id=mainNav]": { back: 'showButtons', }, </code></pre> <p>get triggered when the user hits the back button (doesnt matter if he id in newsDetail or eventsDetail) but I want to know which view the user sees after he taps the back button.</p> <p>If he sees the news list then I want to show both buttons (filter and seetings) but is he sees the events list I only want to show one button. I need something like:</p> <pre><code>showButtons: function(component, options) { if(Ext.getCmp(backButton).down().getId() == 'newsList'){ //show 2 buttons }else{ //show one button } } </code></pre> <p>Sorry if the answer is confusing... I dont know how I could explain it better. Anyway, I would appreciate any help/idea!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload