Results 1 to 2 of 2

Thread: Linkify question

  1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    1
    Vote Rating
    0
      0  

    Default 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 User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Answers
    3976
    Vote Rating
    1381
      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 @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

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