Results 1 to 2 of 2

Thread: 'singleton' view

  1. #1
    Sencha User
    Join Date
    Nov 2010

    Default 'singleton' view

    Hi all;
    in 1.x I had a single overlay used by my app to display stuff on lists clicks (I just changed its content on every click). in 1.x, the overlay was a global parameter. in 2.x with the new MVC structure, I created an overlay view. thing is, I only want one instance of this view and I want it to be shared by multiple views (again, showing/hiding it and updating its content when needed).
    what is the proper architectural approach for a thing like this?

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL


    Do somethign like this:

    Ext.define('MyApp.view.Overlay', {
        extend    : 'Ext.Panel',
        xtype     : 'myapp-overlay',
        singleton : true,
        config : {
            centered : true,
            modal    : true,
            html     : 'Foo'
        name : 'MyApp',
        launch : function () {
            //needs to be added to viewport
            //hide it or else it will show
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:

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