$col["formatter"] syntax

Questions$col["formatter"] syntax
Darryl Brady asked 5 years ago

Looking to get a link to work that goes to

with Series4162_cons101_item1_p002 being what I list in the database but can't seem to get the code to add the _resize.jpg to the end…
currently getting

can anyone see the error in my $col

$col["formatter"] = "function(cellval,options,rowdata){ return '<a target="_blank" href="/genealogy/documents/'+cellval+'"_resize.jpg">'+cellval+'</a>'; }";

$col["unformat"] = "function(cellval,options,cell){ return $('a', cell).attr('href').replace('/genealogy/documents/',''); }";


2 Answers
Abu Ghufran answered 5 years ago

I think there is extra " before _resize.jpg

$col["formatter"] = "function(cellval,options,rowdata){ return '<a target="_blank" href="/genealogy/documents/'+cellval+'_resize.jpg">'+cellval+'</a>'; }";

Darryl Brady answered 5 years ago

Thanks Abu
Worked a treat…

Working page at

Your Answer

7 + 7 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.

How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!