Results 1 to 5 of 5

Thread: changing a panel's bodyCfg

  1. #1
    TheMonolith
    Guest

    Default changing a panel's bodyCfg

    I have defined a panel with the bodyCfg config option ot display a background image:

    Code:
    var previewPanel = new Ext.Panel(
    {
        title:    'Vorschau',
        iconCls:  'magnifierIcon',
        id:       'previewPanel',
        width:    getTitleBarWidth(previewImagePath, 400, 600),
        height:   600,
        border:   false,
        bodyCfg: 
        {
            tag:  'div',
            html: '<img src=' + previewImagePath + ' style=\'max-width:400px; max-height: 600px;\'>'
        },
        plugins: new Ext.ux.DataTip
        ({
            html: '<div>' + toolTipTexts["previewPanel"] + '</div>'
        }),
        x: 50,
        y: 50
    });
    Now I want to change that background image, but I don't know why because there is no "setBodyCfg" method. So I guess it has to be done using the public body property, however I haven't found an example for that yet.

    Your help is greatly appreciated.

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    there's examples of DOM manipulation everywhere

  3. #3
    TheMonolith
    Guest

    Default

    After reading old threads for 20 years, I found this solution:

    Ext.getCmp('previewPanel').body.update(newHtml);

    It works.

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    Oh. Instead of just thinking. "Hmm. The body property. The API docs tell me it is an Ext.Element, and kindly provide a link to it. I'll follow it and see what methods it provides"? Hmm?

    Why is is that nowadays people insist on having information looked up for them from primary sources, and then copied and pasted into forums? Or on copy/pasting code they do not fully understand?

    What happened before there were web forums?

    I'll tell you.

    This:

    The famed VMS "grey wall". The font of all wisdom for a VMS developer.

    This is how I cut my teeth in developing.

    Back then, if you didn't know how to do something, you didn't buy a chatty book, that treated you like a pal, and persuaded you to learn. You read the manual which was written in technical language to impart correct information.

    Comprehending texts like that is a dying art.

    People have got too used to no documentation, and just cobbling information together from "teh interwebs".

  5. #5
    Sencha User sosy's Avatar
    Join Date
    Jun 2010
    Location
    Bremen, but Dutch origin
    Posts
    64

    Default Maybe you are right

    Hello Animal,

    i am working with Ext now for 5 weeks, and managed to find almost everything by myself by reading, reading, reading.

    You maybe making an point that it is way tooo easy to post an question in here. That could be true..

    BUT! And now i am speaking for myself, probably for a lot of other users too, you happend to be
    grown up with english as your mother-tongue. I did not! I learned english in school when i was aged 12.

    So it is easy for you to understand everything written here, but we could view it from another perspective.

    I am happy to speak 5 languages, how about you?

    I am seeking for an solution for over 2 hours, and bumped into this post, after i have read
    many, many many posts, and with a lot of animal answers in it.

    RTFM..

    You maybe right, but i can tell you, thats sometimes it is difficult to find the right search criteria,
    especially when you are an starter and english is not your native language.

    In the beginning i thought he is right, but this post with the picture of an old-dated hooked up room
    with some stuff in it, did it to me.

    This forum is here to help each other, and not to play an school master.

    Sorry, for this post, but it has to do with respect.

    If you have the opinion that this user's question is rubbish, skip to the next post, no one is
    asking you for such an answer.

    I needed to say this, no hard feelings.

    Regards
    Sosy
    I prefer an sister in the red-light district, to an brother with internet explorer..

Posting Permissions

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