Results 1 to 4 of 4

Thread: getting object refs between overlapped modal windows

  1. #1
    Sencha User
    Join Date
    Aug 2010
    Posts
    60

    Default getting object refs between overlapped modal windows

    Following difficult case with 3 windows (App.ux.window is an own Ext.Window extension):

    App.publisherRevenueShareEdit.window = Ext.extend(App.ux.window, {
    ...
    ,listeners: {
    ,save: function() {
    ...
    }

    ,initComponent: function() {

    this.items = [{
    xtype: 'form'
    ...
    });


    App.publisherRevenueShares.window = Ext.extend(App.ux.window, {
    ...
    initComponent: function() {

    this.items = [{
    xtype: 'grid'
    ... // somewhere opening new App.publisherRevenueShareEdit.window for editing
    });


    App.publisher.window = Ext.extend(App.ux.window, {
    ...
    initComponent: function() {

    this.items = [
    {
    xtype: 'form',
    ...
    {
    xtype: 'textfield',
    buttons: {
    handler: function(button, field, event)
    {
    var win = new App.publisherRevenueShares.window();
    win.show();
    ....

    Case is the following:

    I have the window App.publisher.window with a form with a textfield (which only displaying a value and is disabled) and one button to edit align right from it. By clicking on this button, I open a new modal window App.publisherRevenueShares.window which contains a new grid. There I have to edit one row by opening another new modal window App.publisherRevenueShareEdit.window which contains a form and a save listener.
    In this save function I do not want to save the values only but also to refresh the value of the textfield from my first window.

    Now is my question: How can I get access to this textfield? I have tried very much in the save function with ownerCt and stuff... but was not really successful.

    Can anybody help with that? I do not want to use ids here only itemIds

  2. #2

    Default

    You could setup an event on App.publisherRevenueShareEdit.window which bubbles up all the way to App.publisher.window. From my understanding if you add a window to a component things like event bubbling, ownerCt, and ref / refOwner all get resolved even though the window is standalone and is not controlled by the container.

  3. #3
    Sencha User
    Join Date
    Aug 2010
    Posts
    60

    Default

    thanks for the tipp with the bubbling. Unfortunately I did not have worked with that. What might this look like in my code? Is it this config-option bubbleEvents?

  4. #4

    Default

    Check out the source code to see how you can use enableBubble and getBubbleTarget. At it's most basic level using enableBubble will just fire the event on ownerCt; so if you have every window added into its parent windows container then the events will bubble up naturally.

    http://dev.sencha.com/deploy/dev/doc...e-enableBubble

    Code:
    App.publisher.window = Ext.extend(App.ux.window, {
    ...
    initComponent: function() {
    this.listeners: {
      revenueedit : this.doWhatever
    }
    this.items = [
    {
    xtype: 'form',
    ...
    {
    xtype: 'textfield',
    buttons: {
    handler: function(button, field, event)
    {
    var win = new App.publisherRevenueShares.window();
    appPubWindow.add(win);
    win.show();
    Code:
    xtype: 'grid',
    initComponent: function() {
     this.enableBubble('revenueedit');
    }
    ... // somewhere opening new App.publisherRevenueShareEdit.window for editing
    doEdit : function(){
        var win = new App.publisherRevenueShareEdit.window();
        appPubRevSharesWindow.add(win);
        win.show();
    }
    Code:
    App.publisherRevenueShareEdit.window = Ext.extend(App.ux.window, {
       initComponent: function() {
         this.enableBubble('revenueedit');
       }
    }

Similar Threads

  1. Nested Modal windows
    By onuraktas in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 5 Jan 2010, 1:53 PM
  2. Two modal windows above one mask
    By rjett in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 30 Oct 2009, 9:52 AM
  3. multiple windows and modal
    By mmasters in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 26 Aug 2009, 8:58 PM
  4. howto modal windows
    By endlichstudent in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 8 Apr 2009, 6:38 PM

Posting Permissions

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