So a viable alternative could be to have an tag only on the first column, displayed as a regular link, and give it the role of navigating the whole row. Clickable rows is not a great UX experience: it's not easy to visually mark them as clickable, and it poses challenges when multiple parts are clickable within the rows, like buttons. Note: To customize the Screen Tip that appears. In the list, select the heading or bookmark that you want to link to. Under Link to, click Place in This Document. Select the text or object you want to use as a hyperlink. The last approach, which I recommend to seriously thinking of, is to not using clickable rows at all. After you’ve marked the destination, you’re ready to add the link. You can use Bootstrap jQuery callbacks like this (in a document.ready callback): $("#container").on('click-row.bs.table', function (e, row, $element). The same handler would take care of all the rows. Read up on jQuery and how to write handlers Īdvantage of using a class over id is that you can apply the solution to multiple rows: Īnd your code base doesn't change. Of course you don't have to use href or switch locations, you can do whatever you like in the click handler function. You are using Bootstrap which means you are using jQuery :^), so one way to do it is: (Was non idiomatic even back in 2017) Original Answer Preserved for posterity but surely the wrong approach in 2020. Please look at other answers below, especially ones that do not use jquery.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |