1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    1
    Vote Rating
    0
    clearprop is on a distinguished road

      0  

    Default Unanswered: Linkify question

    Unanswered: Linkify question


    I've been trying and googling for hours, and cannot find a solution. Perhaps you have a solution for me.

    I'm trying to linkify url's in my feed. My Twitter and blog posts always have links and I'd like them to be clickable.

    Code:
    Ext.define('Gallery.view.Feed', {
        extend: 'Ext.navigation.View',
        xtype: 'feed',
        fullscreen: true,
    
    
        config: {
            title: 'Feed',
            iconCls: 'download',
            cls: 'feed',
            scrolable: true,
            
            items: [
                {
                    xtype: 'nestedlist',
                    title: 'Feed-Me',
                    iconCls: 'star',
                    displayField: 'title',
        
                    store: {
                        type: 'tree',
        
                        fields: [
    'title', 'link', 'author', 'contentSnippet', 'content',
                            {name: 'leaf', defaultValue: true}
                        ],
        
                        root: {
                            leaf: false
                        },
        
                        proxy: {
                            type: 'jsonp',
                            url: 'https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&q=http://mix.chimpfeedr.com/cabf1-gallery1&num=20',
                            reader: {
                                type: 'json',
                                rootProperty: 'responseData.feed.entries'
                            }
                        }
                    },
        
                    detailCard: {
                        xtype: 'panel',
                        scrollable: true,
                        styleHtmlContent: true
                    },
        
                    listeners: {
                        itemtap: function(nestedList, list, index, element, post) {
                            this.getDetailCard().setHtml(post.get('content'));
                        }
                    }
                }
            ]                
        }
    });

    I've seen examples of this when using a template. Is there any easy way to implement linkify without using a template? If not, what would be the best way to implement a linkified template here?

    Thanks!

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,812
    Answers
    3467
    Vote Rating
    834
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Create your own model and specify the fields and use the convert config on the field. Within this convert method you can use the replace method on the string and use RegExp
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread