user1572225
user1572225

Reputation:

How to add URL in grid view in ext js?

I want to add URL at run time in a grid view in Ext Js and clicking this URL will open a new form at another panel on same page.

Upvotes: 0

Views: 85

Answers (1)

rixo
rixo

Reputation: 25041

Configure a renderer for your column. If your have a url field in your model, that would be something like this:

columns: [
    {
        dataIndex: 'url'
        ,text: "URL"
        ,renderer: function(value) {
            return Ext.isEmpty(value)
                ? ''
                : '<a href="' + value + '" target="_blank">' + value + '</a>';
        }
    }
    ...
]

Upvotes: 1

Related Questions