Bootstrap-table: selectively show detailsView icon [solved]

Created on 29 Jul 2016  路  6Comments  路  Source: wenzhixin/bootstrap-table

when I set detailsView=true, all the rows have a '+' button to show details view,
but I want only some specific rows have the details view.
for example only when row.text.length>140.

Any way to do that?Thanks.

Most helpful comment

@akakoori - thanks for fiddle, as said above this is for us to test and proof suggestions, needed for almost all issues where you asking for help.

http://jsfiddle.net/dabros/e3nk137y/7845/

No need to overcomplicate the detailFormatter, just use rowStyle. Based on certain conditions, return certain classes, then pick up on those via css.

All 6 comments

Please provide a Fiddle and we can help you more, dummy data from js array is fine (just needs to replicate core issue). If you need data url then see http://stackoverflow.com/questions/7194408/how-can-i-use-the-jsfiddle-echo-feature-with-jquery

Examples and guide provided below:

It needs to have detailsView enabled with comparable data complexity and such so we can test and/or proof our suggestions

Im sorry but I am just asking a question (or requesting a feature) , not reporting a bug or issue.
I want to know if any way to let only some specific rows have the details button when have detailsView enabled.
I have read the doc and found no such kind of option or methods.
Do I really need to provide a fiddle?

http://jsfiddle.net/e3nk137y/7811/
for example,
I want only when row.stargazers_count>100, will the row have a details button.
In other words, a feature that when detailFormmater returns false, set the details button of the row to display:none?

@akakoori - thanks for fiddle, as said above this is for us to test and proof suggestions, needed for almost all issues where you asking for help.

http://jsfiddle.net/dabros/e3nk137y/7845/

No need to overcomplicate the detailFormatter, just use rowStyle. Based on certain conditions, return certain classes, then pick up on those via css.

@dabros wow, never thought that, great idea!thank you!

@akakoori - please close this issue

Also, my personal preference only, please also update title to include "[solved]", maybe something like "selectively show detailsView icon [solved]" would be best for future searches

thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sbellani picture sbellani  路  4Comments

BallaLakshmi picture BallaLakshmi  路  3Comments

Sivalingaamorthy picture Sivalingaamorthy  路  5Comments

iamthestreets picture iamthestreets  路  5Comments

tianyaxue picture tianyaxue  路  3Comments