1. #1
    Sencha User
    Join Date
    Feb 2010
    Posts
    353
    Answers
    14
    Vote Rating
    4
    maneljn is on a distinguished road

      0  

    Default Answered: how to show url link in grid column

    Answered: how to show url link in grid column


    I have a textfield saved in database that can contains a string value like this:

    Code:
    some text bla bla bla http://www.google.com some more text bla bla alb ala bla
    I want to show this field inside a grid column, but converting the "http://....." in a url link (<a href =".....)

    Is it possible ?
    -------------------
    Manel Juàrez

  2. i've found this solution. It works very well.

    https://github.com/cowboy/javascript-linkify/

  3. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,572
    Answers
    540
    Vote Rating
    310
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Just use a renderer function on the column:

    http://docs.sencha.com/ext-js/4-1/#!...n-cfg-renderer

    You can return whatever HTML you want.

  4. #3
    Sencha User
    Join Date
    Feb 2010
    Posts
    353
    Answers
    14
    Vote Rating
    4
    maneljn is on a distinguished road

      0  

    Default


    Yes Skirtle, i know the use of renderer, but my question is how can i "detect" that inside the text are strings like http://...... , and how can i make substitution of this string adding the html tags for url link <a href=.......


    Manel
    -------------------
    Manel Juàrez

  5. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,572
    Answers
    540
    Vote Rating
    310
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Identifying URLs in text isn't really an ExtJS question but I guess you could do something using a regular expression:

    Code:
    renderer: function(value) {
        return value.replace(/(https?:\/\/\S+)/g, '<a href="$1">$1</a>');
    }
    You'll have to do some experimenting to refine the expression to pick out exactly what you want.

  6. #5
    Sencha User
    Join Date
    Feb 2010
    Posts
    353
    Answers
    14
    Vote Rating
    4
    maneljn is on a distinguished road

      0  

    Default


    i've found this solution. It works very well.

    https://github.com/cowboy/javascript-linkify/
    -------------------
    Manel Juàrez

  7. #6
    Sencha User
    Join Date
    Dec 2013
    Posts
    1
    Vote Rating
    0
    maxlau11 is on a distinguished road

      0  

    Default


    This in an easy solution:
    Code:
    {
    html:'blah blah blah <a href="http://google.com" title="http://google.com">google.com</a> blah blah blah',
    }

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi