$col["formatter"] syntax

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

Looking to get a link to work that goes to
http://www.bradyfamilytree.org/genealogy/documents/Series4162_cons101_item1_p002_resize.jpg

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
http://www.bradyfamilytree.org/genealogy/documents/Series4162_cons101_item1_p002

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/',''); }";

thanks
Darryl

2 Answers
Abu Ghufran answered 9 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 9 years ago

Thanks Abu
Worked a treat…

Working page at
http://www.bradyfamilytree.org/genealogy/1859YorkCensus.php

Your Answer

1 + 20 =

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 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

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

Let us improve this post!

Tell us how we can improve this post?