Fawar
Fawar

Reputation: 735

Add OnTap to a TitleBar

I need to be able to hide the grid(what's under the Food titlebar) when the food title bar is tapped.

From what I have found I had to use Event Delegation, but for some reason my testing with an Alert() didnt do anything when I had click on Food TitleBar.

Can someone help me? (Using architect, so it would be easier for me to have the solution using architect since most of the code generated is ReadOnly -_-')

http://img844.imageshack.us/img844/5809/capturedecran20130523a1.png

Upvotes: 0

Views: 629

Answers (1)

blessanm86
blessanm86

Reputation: 31789

I've only used architect once. But Im pretty sure there is an interface to edit the code that it is generated. Here is the demo to implement a click on the titlebar.

Ext.Loader.setConfig({
    enabled: true
});

Ext.application({
    name: ('SF' || 'SenchaFiddle'),

    launch: function () {
        Ext.define('MyApp.view.home', {
            extend: 'Ext.Container',
            xtype: 'homecontainer',
            config: {
                items: [{
                    xtype: 'toolbar',
                    title: 'test',
                    dock: 'top',
                    listeners: {
                        painted: function (element, opt) {
                            element.on('tap', function () {
                                alert('Test');
                            });
                        }
                    }
                }]
            }
        });

        Ext.Viewport.add(Ext.create('MyApp.view.home'));
    }
});

Upvotes: 1

Related Questions