Skip to content
This repository has been archived by the owner on Apr 2, 2019. It is now read-only.

Link Cell #41

Closed
timc3 opened this issue Feb 4, 2013 · 7 comments
Closed

Link Cell #41

timc3 opened this issue Feb 4, 2013 · 7 comments

Comments

@timc3
Copy link

timc3 commented Feb 4, 2013

I was looking for a cell which can display a link with a different display label to the link URI.

Obviously there is a URI cell but given "http://santaclaus.com/rednose/" I would like to display "RedNose"

Does one of the existing cell types match this use case (I have already implemented a custom cell type like this)?

@wyuenho
Copy link
Contributor

wyuenho commented Feb 4, 2013

Nope. There's no built-in cell type that does custom URL rendering. This is something best implemented by yourself as an end-user. However, if you are happy with your custom cell type and have it on a public repo, you are welcomed to put a link to it on Backgrid's repo wiki.

@dandavison
Copy link

@timc3 you can do this a bit more easily now. See #88.

@wyuenho
Copy link
Contributor

wyuenho commented Mar 29, 2013

@dandavison @timc3 I've decided to revert #90 and #88 because displayText is inconsistent with Backgrid's design. There are already a number of ways where you can dictate how a column value is displayed. You can either subclass a cell type, or use a custom formatter.

http://wyuenho.github.com/backgrid/#api-formatter
http://wyuenho.github.com/backgrid/api/index.html#!/api/Backgrid.Column-method-initialize

@dandavison
Copy link

@wyuenho That's fine, I understand. It was just a hack, creating an ad-hoc interface for one particular class. I'll try to think abut whether anything else could be done (e.g. documentation) to make this common task easier for the user.

@timc3
Copy link
Author

timc3 commented Apr 23, 2013

Ok great, no problem.

@morficus
Copy link
Contributor

sorry for reactivating an old issue, but would you mind taking a look at my implementation of this enhancement and let me know if I should issue a PR: https://github.com/morficus/backgrid/compare

I believe that it's cleaner than the previously submited ones, and follows the same implementation patterns as the current UriCell (displayText is an optional configuration option vs being a function that needs to be over written)

@wyuenho
Copy link
Contributor

wyuenho commented Aug 14, 2013

This problem has already been addressed in a more flexible way in 74468a4, which is a solution for #263

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants