This is a migrated thread and some comments may be shown as answers.

Hyperlinking a grid field

3 Answers 112 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Codeanimal
Top achievements
Rank 1
Codeanimal asked on 02 Oct 2011, 08:05 AM
I'm sure it's blindingly obvious to a lot of people on how to make the contents of a grid field into a hyperlink, but it took me a minute to figure it out.

If you have a field called 'name', and then a field called 'url', then to make 'name' link to 'url':

...
columns:
  [             
   {                 
   field: "name",                 
   title: "Name",
   template: '<a href ="<#= url #>"><#= name #></a>'
   
      
   },

...

3 Answers, 1 is accepted

Sort by
0
zhang
Top achievements
Rank 1
answered on 13 Oct 2011, 11:22 AM
i really can not understand the document completely,

i want to insert html tag into a grid field, but template doesn't  work, empty value ??

in you code,  where the 'url' from ?

can you show a complete code for me? not remote data.

im not good at english , thank you very much!
0
zhang
Top achievements
Rank 1
answered on 13 Oct 2011, 11:22 AM
i really can not understand the document completely,

i want to insert html tag into a grid field, but template doesn't  work, empty value ??

in you code,  where the 'url' from ?

can you show a complete code for me? not remote data.

im not good at english , thank you very much!
0
zhang
Top achievements
Rank 1
answered on 13 Oct 2011, 11:23 AM
i really can not understand the document completely,

i want to insert html tag into a grid field, but template doesn't  work, empty value ??

in you code,  where the 'url' from ?

can you show a complete code for me? not remote data.

im not good at english , thank you very much!
Tags
Grid
Asked by
Codeanimal
Top achievements
Rank 1
Answers by
zhang
Top achievements
Rank 1
Share this question
or