[CLOSED] [1.0] Window show / hide from JS

  1. #1

    [CLOSED] [1.0] Window show / hide from JS



    CLOSED - I have just updated to the latest version from the SVN and now it works

    ------------------------------------


    I have a javascript button which should show/hide a window.
    The window is created from code-behind:

    Window templateWindow = new Window();
    templatewindow.Width = 300;
    templatewindow.Height = 160;
    templatewindow.Icon = Icon.HtmlAdd;
    templatewindow.Padding = 5;
    templatewindow.Title = "Select template";
    templatewindow.ID = "AdoreTemplateWindow";
    templatewindow.IDMode = IDMode.Static;
    templatewindow.CloseAction = CloseAction.Hide;
    //templatewindow.Modal = true;
    //templatewindow.Visible = true;
    templatewindow.Hidden = true;
    templatewindow.Html = "TEST";
    This is the function to show the window:

    function insertTemplate() {
        var win = Ext.get('AdoreTemplateWindow');
        win.show(this);
        alert(win.id);
    }
    From the alert I get its ID, but it won't show me the Window when Clicking the button.

    The button is placed in the HtmlEditor:



    HtmlEditor.tb.addButton({ handler: insertTemplate, iconCls: 'icon-htmladd', tooltip: 'Insert Template<br>Adds a template to your document' });
    Any suggestions?
  2. #2

    RE: [CLOSED] [1.0] Window show / hide from JS

    Hi,

    I am not sure how it works after update from SVN but you have to use 'getCmp' instead 'get'
    var win = Ext.getCmp('AdoreTemplateWindow');
    Also all Ext.NET controls register own id as global variable therefore you can use it directly
    AdoreTemplatewindow.show();
  3. #3

    RE: [CLOSED] [1.0] Window show / hide from JS

    You are abosolutely right! That was the other thing I changed ;-)

Similar Threads

  1. [CLOSED] How to show message prompt with window 'Hide' listener?
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Jul 13, 2012, 2:51 PM
  2. Replies: 3
    Last Post: Mar 19, 2012, 12:35 PM
  3. Replies: 1
    Last Post: Jan 27, 2012, 11:32 AM
  4. [CLOSED] Show and hide two panes
    By Etisbew in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 04, 2009, 10:54 AM
  5. [CLOSED] ToolbarSeparator show hide
    By methode in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 25, 2009, 2:25 PM

Posting Permissions