Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: [RESOLVED] Refreshing html option of a panel

  1. #1
    Sencha User
    Join Date
    Dec 2008
    Location
    France
    Posts
    321

    Default [RESOLVED] Refreshing html option of a panel

    I select a data from a combo.
    Then, i would like that the html option of a panel were refreshed.
    But it's never refreshed.

    The panel

    Code:
    .....
        new Ext.Panel({
            layout: 'anchor',
            items:[{
                title: 'Panel 1',
                height: 100,
                bodyStyle: 'background-color: #4E79B2;',
                items:[
                    {
                    id: 'idjs_maj',
                    html: 'Html content to update'
                    },
    ......


    The code when selecting in the combo


    Code:
    listeners: {
            select': {fn:
                   function(){
                            Rebour("'date1'", "'date2'", Ext.getCmp('idjs_maj'));
                    }
            }
    }


    The function "Rebour"


    Code:
    function Rebour(date_maj, date_prochaine, div)    {
            .......
            date_dif = "Updated html content";
            div.html = date_dif;
            .......
    }

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

    Default

    Read and think about your code.

    What does Ext.getCmp("some id here") return?

    You MUST know this to use Ext.

    What can just setting a member property of whatever that thing is do?

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

    Default

    And "The panel" that you have is a Panel in a Panel in a Panel!

    Why would you do that?

  4. #4
    Sencha User
    Join Date
    Dec 2008
    Location
    France
    Posts
    321

    Default

    Quote Originally Posted by Animal View Post
    Read and think about your code.

    What does Ext.getCmp("some id here") return?

    You MUST know this to use Ext.
    I think it returns an object, isn't it ?

    And this object has some option, like html.

    Quote Originally Posted by Animal View Post
    What can just setting a member property of whatever that thing is do?
    Sorry, i don't understand what you mean.

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

    Default

    An object? Everything is an object. Functions, Strings, DOM elements, the browser window, Ext Components.

    This is an object based language with weak typing.

    So you must know what class of object you are dealing with, and perform valid actions upon it.

    Just inventing the concept that some unknown "object" has an "option" like html is crazy. You are inventing random bits of code.

    I ask again, and you can find this out. What does Ext.getCmp return?

  6. #6
    Sencha User
    Join Date
    Dec 2008
    Location
    France
    Posts
    321

    Default

    I've already used Ext.getCmp :

    Code:
    Ext.getCmp('idjs_debut').allowBlank = false;
    where idjs_debut is the id of a textfield, and it's working.

    So why it can be the same for the html option of a panel ?

    I will rest my brain this week-end and try to find some explanation next week, with your help and patience.
    Thanks.

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

    Default

    That's just an internal flag used by the field's processing at the time it performs validation.

    In a language like Javascript which has no private members, and can enforce no getters and setters, there is no guarantee that setting a property will have an affect. It's just setting a variable, that's all.

    The property needs to be processed.

    Configuration options are processed at construction time.

    If you want to update the body of a Panel, you will have to perform a method on it.

  8. #8

    Default

    getCmp('idjs_debut').allowBlank = false

    you can set to true, and try putting the alert('alert u want');
    Last edited by seowebmaster; 14 Aug 2009 at 7:45 PM. Reason: Removed spam.

  9. #9
    Sencha User hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,966

    Default

    Interesting SPAM approach
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


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

    Default

    Duh!

    I fink I'll click on vat link....

    (What do they think we are?)

Page 1 of 2 12 LastLast

Posting Permissions

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