[CLOSED] add panel before render buttom on initComponent

  1. #1

    [CLOSED] add panel before render buttom on initComponent

    how can I add a panel before creating the button in initComponent method of Button.js (override) file.
    rum always creates one additional button panel
    sorry my english is not good.

    ----- panel
    --------- button
    Last edited by Daniil; Feb 21, 2014 at 11:09 AM. Reason: [CLOSED]
  2. #2
    Quote Originally Posted by abadeleandro View Post
    how add panel before render buttom on initComponent or in class Button.js override
    Please rephrase your question. I'm not 100% sure what you are asking.
    Geoffrey McGill
    Founder & CEO
  3. #3
    how can I add a panel before creating the button in initComponent method of Button.js (override) file.
    rum always creates one additional button panel
    sorry my english is not good.

    ----- panel
    --------- button
  4. #4
    Quote Originally Posted by abadeleandro View Post
    how can I add a panel before creating the button in initComponent method of Button.js (override) file.
    rum always creates one additional button panel
    sorry my english is not good.

    ----- panel
    --------- button
    Can you explain why you would want to do this? Why put a Panel before every Button? I'm pretty sure this will not work under many scenarios.
    Geoffrey McGill
    Founder & CEO
  5. #5
    Quote Originally Posted by geoffrey.mcgill View Post
    Can you explain why you would want to do this? Why put a Panel before every Button? I'm pretty sure this will not work under many scenarios.
    because I'm doing a customization and would want to have a <div> button to run before my class (custom-css) it

    <div class="mybtngroup"> >>> panel 
    
    <botao> >> button 
    
    </ div>
  6. #6
    What kind of customization are you doing? You can apply a CSS class to a Button via its Cls property.
    http://docs.sencha.com/extjs/4.2.1/#...Button-cfg-cls

    We recommend not to use a Panel for that. It is very-very heavy weight and, as Geoffrey already said, it is just not going to work well.
  7. #7
    Quote Originally Posted by Daniil View Post
    What kind of customization are you doing? You can apply a CSS class to a Button via its Cls property.
    http://docs.sencha.com/extjs/4.2.1/#...Button-cfg-cls

    We recommend not to use a Panel for that. It is very-very heavy weight and, as Geoffrey already said, it is just not going to work well.
    In some cases not all need a
    <div>
    <a>
    before so I thought the panel, but if you have another way to accept suggestions, cls already used the more accurate div tb'm doing a customization for my system.
  8. #8
    Please clarify why do you need those <div> and <a> sometimes?

    Even if it would be easy possible with Buttons, we would not recommend to do it, because each Button already renders some HTML markup which is quite complex.
  9. #9
    Quote Originally Posted by Daniil View Post
    Please clarify why do you need those <div> and <a> sometimes?

    Even if it would be easy possible with Buttons, we would not recommend to do it, because each Button already renders some HTML markup which is quite complex.

    in some cases I have a custom button with some different css my css asks a div before the button, customized layout.
  10. #10
    Ok, if you want to override the default Button, it should look like this:
    Ext.button.Button.override({
        initComponent: function() {
            // your code
        }
    });
    Still we would suggest to change the CSS part.

Similar Threads

  1. Render Panel via JS after RemoveAll not repaint
    By asics167 in forum 2.x Help
    Replies: 1
    Last Post: Oct 12, 2013, 8:02 AM
  2. How to save all details on submit buttom in MVC
    By Dharmesh in forum 1.x Help
    Replies: 0
    Last Post: Jul 24, 2012, 9:54 AM
  3. Replies: 4
    Last Post: Jan 20, 2012, 2:20 PM
  4. [CLOSED] [1.0] Render Panel to a non-ext object
    By Patrick in forum 1.x Premium Help
    Replies: 2
    Last Post: Feb 10, 2010, 12:13 PM
  5. [CLOSED] [1.0] render panel
    By PoloTheMonk in forum 1.x Premium Help
    Replies: 3
    Last Post: Jan 06, 2010, 1:50 PM

Tags for this Thread

Posting Permissions