1. #1
    Sencha User
    Join Date
    Jul 2012
    Location
    France
    Posts
    10
    Answers
    1
    Vote Rating
    0
    elardev is on a distinguished road

      0  

    Default Unanswered: Hyperlink via Sencha Ext JS 4.1

    Unanswered: Hyperlink via Sencha Ext JS 4.1


    Hi, everyone, I'd like to know how to create an hyperlink via Ext JS. Can somebody Help ?

    -------------------------------------------------

    Sorry, I managed to find it

    {
    xtype: 'component',
    autoEl: {
    tag: 'a',
    href: '/* la destination - target */',
    html: '/* le texte du lien - text to display */'
    }
    }
    Last edited by elardev; 13 Jul 2012 at 7:04 AM. Reason: Solved

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Answers
    124
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    Hi,
    I have created a panel & inside that I create a anchor by overriding the el of component. Review the following code:

    Code:
    
    Ext.create('Ext.Panel', {
        title: 'myPanel',
        items: [
            {
                xtype: 'component',
                autoEl: {
                    tag: 'a',
                    href: 'http://www.google.com',
                    html: 'Click to open google'
                }
            }
        ],
        renderTo: Ext.getBody(),
        height: 100,
        width: 200
        
    });
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Location
    France
    Posts
    10
    Answers
    1
    Vote Rating
    0
    elardev is on a distinguished road

      0  

    Default


    Thank you for answering I'm a little lazy sometimes, but I managed to find it out thanks

  4. #4
    Sencha User
    Join Date
    May 2012
    Posts
    49
    Vote Rating
    0
    anmol is on a distinguished road

      0  

    Default


    hi sword-it,
    That's a good solution to get the hyperlink.
    Your solutions are always proved helpful to me.
    Can you please tell me how to call any javascript function when i click to the hyperlink which you have given.
    Can i write a javascript function in 'href'.
    I tried 'href: 'javascript:alert('hi')''
    But its not working.
    Can you suggest any solution.