Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically add links to dynatable #122

Closed
akzogibbs opened this issue May 19, 2014 · 5 comments
Closed

Dynamically add links to dynatable #122

akzogibbs opened this issue May 19, 2014 · 5 comments

Comments

@akzogibbs
Copy link

I don't have links in my json but i would like each row in my table to have a href added to it.

Can anyone point me to an example of how this can be implimented please?

Thanks.

@reddybabu1
Copy link

You have to re-recreate JSON object using each iteration.I think it is not a part of DYNATABLE.

Use this code

$(jsonobject).each(function() {
var your_row_content =""+this.your_json_content+";
this.your_json_content = your_row_content;
});

Now jsonobject will avilabele with Href

@Mewit
Copy link

Mewit commented May 21, 2014

Maybe I'm misunderstanding the issue, and maybe my solution isn't the best option, but I put links in a dynatable just by making the JSON entry the link. For example:

{'exampleLink' : '<a href = http://www.example.com>Example Text</a>'}

@akzogibbs
Copy link
Author

Thanks! Mewit & reddybabu1 i managed to put a link directly onto some text using Mewit's method. It's not ideal but it's a good start. If i could find a way of adding a button to each Row then i could add a link in the same way hopefully.

Reddybabu1 can you point me to an example of what you've described please? I get that you've targeted each object which is a row, but then how would i apply a link to each ojbect? Would i still need to pass a href in the json file?

@akzogibbs
Copy link
Author

I managed to figure out what i was trying to do which was...

To capture the id of the link and then use that data to provide other json data associated with that links location. It's always seems really easy once you've figured it out.

http://jsfiddle.net/AkzoGibbs/W8gyE/

@drouillard
Copy link
Contributor

Closing as it appears solution found

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

No branches or pull requests

4 participants