Results 1 to 8 of 8

Thread: [SOLVED] Newbi: Put some html text insede a formpanel

  1. #1

    Thumbs up [SOLVED] Newbi: Put some html text insede a formpanel

    I tried some component, but nothing worked for me. So I have a form panel which contins 2 textfield. Above the textfield I wolud like to put some text (inside the formpanel). In some events I would like to change this text. What is the component which is good just for showing some changeable html text. Here's the formpanel:

    [PHP] var fpNewIdea = new Ext.form.FormPanel({
    labelAlign: 'left',
    title: '

  2. #2
    Sencha Premium User
    Join Date
    Apr 2007
    Location
    Vienna, Austria
    Posts
    59

    Default

    Hi!

    Quote Originally Posted by BKrisz79 View Post
    Above the textfield I wolud like to put some text (inside the formpanel). In some events I would like to change this text.
    How about this approach:

    Code:
    items: [
        {
            html: '<span id="text-that-can-be-changed">change me</span>' 
            //Here I would like to put some text which can be changed from a function
        },

  3. #3
    Ext User santosh.rajan's Avatar
    Join Date
    Sep 2007
    Location
    Kannur, Kerala, India
    Posts
    611

    Default

    That will not work because he has defined defaulttype textfield. you need to add xtype: 'panel', next to html:
    Make everything as simple as possible, but not simpler.
    - Albert Einstein

  4. #4
    Sencha Premium User
    Join Date
    Apr 2007
    Location
    Vienna, Austria
    Posts
    59

    Default

    Quote Originally Posted by santosh.rajan View Post
    That will not work because he has defined defaulttype textfield. you need to add xtype: 'panel', next to html:
    I am sorry, you are right. Here is the full code I tested:

    [CODE]var fpNewIdea = new Ext.form.FormPanel(
    {
    labelAlign: 'left',
    title: '

  5. #5

    Default

    Thnx I tried this and it looks working only one big problem. I can't cange the html property it sty everytime 'Abrakadabra'. For example on if you click on the M

  6. #6
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854

    Default

    There is no html property of a tabPanel - setting that does nothing. Assign an id to the html element your create so that you can access it via getCmp and do an update.

  7. #7
    Sencha Premium User
    Join Date
    Apr 2007
    Location
    Vienna, Austria
    Posts
    59

    Default

    Quote Originally Posted by BKrisz79 View Post
    Thnx I tried this and it looks working only one big problem. I can't cange the html property it sty everytime 'Abrakadabra'.
    If you look at my example, you will see, that I gave the span-element an id. Use it to access the element for changing the text.

  8. #8

    Default

    Oh jee. What a simple solution. I was blind. I don't know why don't think about this. Pretty simple.
    ...
    html: '<div id="textID" style="padding-bottom:10px;"></div>',
    ...

    ... document.getElementById('textID').innerHTML = 'Some new text'; ...

    It works great. Really thank you.

Posting Permissions

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