Note that there are some explanatory texts on larger screens.

plurals
  1. POExtJS MVC -- Correct Way to launch dynamic modals
    primarykey
    data
    text
    <p>I'd like to use a single function <code>onLaunchWindow()</code> to launch different unique windows. The event is fired in the view and handled by a switch statement in the controller. In this example I'm firing an "add" event. I'd like to expand on this and include other scenarios such as "remove, edit, etc." My problem is I don't want to have to declare the <code>Ext.window</code> and it's config in my controller but I'm not sure how to proceed otherwise. Ideally I'd like to declare the <code>Ext.window</code> as an object in my view and pass it to the <code>onLaunchWindow()</code> function and change it's config on the fly to suite different needs in my application.</p> <p>More plainly, I think, I need to access and modify the objects config after it has already been constructed. </p> <p>View </p> <pre><code>... , xtype: "button" itemId: "testButton" iconCls: "test-icon test-add" tooltip: "Launch a Modal with Unique Properties" hidden: false margin: "0, 5, 0, 5" cls:'x-btn-default-small' border: 1 handler: () =&gt; action = "add" @fireEvent( 'launchwindow', action ) style: borderColor: '#D1D1D1', borderStyle: 'solid' , ... </code></pre> <p>Controller</p> <pre><code>... control: view: 'launchwindow': ( action ) -&gt; @onLaunchWindow( action ) ... onLaunchWindow: ( action ) -&gt; switch ( action ) when "add" window = Ext.create( "Ext.Window", layout: "fit" width: 500 height: 300 modal: true closeAction: "hide" title: "Add" items: [ { } ] ) ... </code></pre> <p>I've also tried declaring the window as an object in the view and passing it to the <code>onLaunchWindow()</code> function and setting it's config via <code>Ext.apply()</code> this works well for one window but I can't seem to reset the config each time the function is called.</p> <p>Any help would be greatly appreciated!</p>
    singulars
    1. This table or related slice is empty.
    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.
    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