Results 1 to 8 of 8

Thread: How to change hidden property?

  1. #1

    Default How to change hidden property?

    Hello All,

    I want to know how to change hidden property.
    This is my code :
    Code:
    menuDevice.on('click', function(node){
     if(node.isLeaf()){
      nestedCenterCmp = Ext.getCmp('nestedCenter');
      if(nestedCenterCmp.bbar.isVisible()){
       nestedCenterCmp.bbar.hide();
      }
      else{
       nestedCenterCmp.bbar.show();
      }
     }
    });
    This just changes show of the component or not.
    It doesn't change hidden property.

    I know how to get the hidden property.
    Code:
    nestedCenter.bbar.hidden
    'nestedCenter' is a name of container which has a bbar.
    How do I 'set' the property?

    Thanks,
    Stan

  2. #2
    Sencha User Eugen_'s Avatar
    Join Date
    Feb 2010
    Posts
    106

    Default

    Hello!

    maybe you need this:

    Code:
    nestedCenterCmp.bbar.setVisible(!nestedCenterCmp.bbar.isVisible());

  3. #3

    Default

    Thanks for your answer, but
    It changes visibility property to hidden/visible(it is CSS property).
    What I wanted to change is 'hidden' property in ExtJS code.
    'hidden' that I wanted to change is :
    Code:
    deviceListBbar = new Ext.PagingToolbar({
     hidden: false,
    ...
    That hidden.

  4. #4
    Sencha User Eugen_'s Avatar
    Join Date
    Feb 2010
    Posts
    106

    Default

    ?he hidden property is changed when you call the show or hide methods.

    Code:
        /**
         * Show this component.  Listen to the '{@link #beforeshow}' event and return
         * <tt>false</tt> to cancel showing the component.  Fires the '{@link #show}'
         * event after showing the component.
         * @return {Ext.Component} this
         */
        show : function(){
            if(this.fireEvent('beforeshow', this) !== false){
                this.hidden = false;
                if(this.autoRender){
                    this.render(Ext.isBoolean(this.autoRender) ? Ext.getBody() : this.autoRender);
                }
                if(this.rendered){
                    this.onShow();
                }
                this.fireEvent('show', this);
            }
            return this;
        },
    If you need to change hidden property without show or hide toolbar you can override this class.

    Code:
    Ext.override(Ext.Toolbar, {
        setHidden: function(hidden) {
            this.hidden = hidden;
        }
    });
    but why?

  5. #5

    Default

    I wanted to change hidden property like if the property is true then change it into false and if the property is false then change it into true.
    When I set the bbar's hidden property to false, it worked well, but when I set the property to true, it shows nothing however I try to raise the event.
    So I thought that it can not change hidden property.
    Then, why doesn't it work when the property is set to true?

    Following is the code when it worked well :
    the bbar
    Code:
    deviceListBbar = new Ext.PagingToolbar({
     hidden: false,
    ...
    the container which has the bbar
    Code:
    var nestedCenter = {
     ...
     bbar:deviceListBbar
    }
    the event handler
    Code:
    menuDevice.on('click', function(node){
     if(node.isLeaf()){
      nestedCenterCmp = Ext.getCmp('nestedCenter');
      if(nestedCenterCmp.bbar.isVisible()){
       nestedCenterCmp.bbar.hide();
      }
      else{
       nestedCenterCmp.bbar.show();
      }
     }
    });
    In this code, if I run the app and click the menuDevice then it hide the bbar and if I click it again, then it shows the bbar.
    But if I set the value true like this
    Code:
    deviceListBbar = new Ext.PagingToolbar({
     hidden: true,
    ...
    It shows me nothing and however I click the menuDevice, it doesn't show the bbar.
    I think it's very simple problem to solve but I don't know it. I feel tight

  6. #6

    Default

    There are more resources available on web

    chose a perfect keyword and make searches in google
    We offer affordable prices for thalgo, Gehwol, Footlogix Products Now compare prices at different online stores and buy here to save up to 30%.

  7. #7

  8. #8

    Default

    I solved!
    Code:
    menuDevice.on('click', function(node){
     if(node.isLeaf()){
      if(deviceListBbar.isVisible()){
       deviceListBbar.hide();
      }
      else{
       deviceListBbar.show();
      }
     }
    });
    Thanks!!

Similar Threads

  1. Change Hidden Value Before Form Submit
    By smartinec in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 26 May 2010, 10:13 AM
  2. [2.2] Hidden component - change event
    By buglierjul in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 28 Aug 2008, 5:03 AM
  3. Changing the hidden property of the panel cause width problem
    By emredagli in forum Ext 2.x: Help & Discussion
    Replies: 10
    Last Post: 13 Jul 2008, 9:17 AM
  4. Menu.item hidden property undefined?
    By SlashEMc2k in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 23 Nov 2007, 11:25 AM

Posting Permissions

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