flask-gridjs
flask-gridjs copied to clipboard
dropdown with gridjs possible?
Hi @miguelgrinberg ,
Is there a way to have a drop down withing a gridjs table? Any example available.
Will aprpeciate your comments, Thanks,
I don't have any examples specific to a drop-down, but the server example in this repository shows how to add email links, which is somewhat similar in the sense that both require putting HTML in a cell.
Hi @miguelgrinberg ,
Sorry but for some reason I cannot see the insertion of an html email link working on the server example, it looks like simple text in the table to be honest. Maybe is something you haven't push?
Thanks again,
@mhanuel26 This is the commit in which I've changed the emails to be links: https://github.com/miguelgrinberg/flask-gridjs/commit/0067609ce963c7c0b76d5266c60ab92115e7b3b5. The change was made a while ago, so you probably have an outdated repository.
Hi @miguelgrinberg,
Thanks for that, one more question, I noticed that when loading the html this way, the code that does the return is executed 3 times per row on the table, for example after placing a console log before the return like this
{ id: 'email', name: 'Email', formatter: (cell, row) => {
console.log("email");
return gridjs.html('<a href="mailto:' + cell + '">' + cell + '</a>');
}},
I got
Is this expected? I was introducing some javascript code to help in the dropdown thing and noticed this.
Will appreciate your comments, Thanks again,
@mhanuel26 This i something that you need to ask in the gridjs project, I'm not really familiar with its internals. Sorry.