You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to have a table with two different "View detail" (for example, "View detail 1" & "View detail 2") column, depends on which column's cell is clicked, I will make corresponding ajax call to get related data and display them in detail view.
I wish that I could pass in another parameter to "detailFormatter" telling me which column's cell is clicked, then problem solved!
Or, can I have two different "detailFormatter" function, one for each "View Detail" column?
Any suggestions? Thanks very much!
The text was updated successfully, but these errors were encountered:
Hi,
I'm guessing you're talking about clicking in a cell not the column or row, as per the current detail view which is clicking the row.
In the docs http://bootstrap-table.wenzhixin.net.cn/documentation/#events
you could try onClickCell. $('#table').on('click-cell.bs.table', function(field, row, value, element)
Then use expandRow detailed in the Doc "methods" with detailFormatter as normal.
Maybe the only thing that looks a bit odd, would be the details view "+" will be in the first column.
Although it could be possible to hide that column.
Sorry no time for a jsfiddle on this one.
Regards
@ggywebtech , you are correct. I am expanding detail view when "View Detail" cell is clicked, my "+" column is hidden.
The solution I came up with is using a global var to track which column the cell belongs to when it is clicked, in $tbl.on("click-cell.bs.table", function(e, field, value, row, $element) {...}
Then in detailFormatter, based on that global variable, making corresponding ajax call.
It may not be the best solution, but works for now.
Thanks for your response!
Hello All,
I would like to have a table with two different "View detail" (for example, "View detail 1" & "View detail 2") column, depends on which column's cell is clicked, I will make corresponding ajax call to get related data and display them in detail view.
I wish that I could pass in another parameter to "detailFormatter" telling me which column's cell is clicked, then problem solved!
Or, can I have two different "detailFormatter" function, one for each "View Detail" column?
Any suggestions? Thanks very much!
The text was updated successfully, but these errors were encountered: