creativetimofficial / ct-black-dashboard-pro-react

Black Dashboard PRO React: A premium Boostrap & Reactstrap Admin Template
https://www.creative-tim.com/product/black-dashboard-pro-react
40 stars 18 forks source link

Perfect Scroll on <Table responsive> #4

Closed locmai0808 closed 5 years ago

locmai0808 commented 5 years ago

I only want to render <Table responsive> if my get request returns data, so in my code I have the follow:

`let map = null; if (this.state.gotMap) { map = (

Global Sessions by Locations

All Sessions within 30 days

...
USA 2.920 53.23%
...
Germany 1.300 20.43%
...
Australia 760 10.35%
...
United Kingdom 690 7.87%
...
Romania 600 5.94%
...
Brasil 550 4.34%
  );
}`

and in my return I include the "map" jsx element.

However when it renders successfully, perfect scroll isn't added to <div class="table-responsive"> image If I add "ps" to <div class="table-responsive ps">, it would work image

Please check below for my code:

image

What should I do to fix this? Thank you!

einazare commented 5 years ago

Hello there, @locmai0808 ,

Thank you for your interest in working with our product. It seems that you have figured the solution. How can we help you?

Best, Manu

locmai0808 commented 5 years ago

Hello Manu, actually no I couldn't figure out how to fix this. My 'solution' was to add "ps" to <div class="table-responsive ps"> in F12 (Developer Tools of Chrome). And that isn't really a solution then if I had to open Developer Tools to manually add "ps"

Hello there, @locmai0808 ,

Thank you for your interest in working with our product. It seems that you have figured the solution. How can we help you?

Best, Manu

einazare commented 5 years ago

Hello again, @locmai0808 ,

That is what you should do. That is the fix. Here is our live docs about perfect scrollbar: https://demos.creative-tim.com/black-dashboard-pro-react/#/documentation/perfect-scrollbar If you navigate inside src/layouts/Admin/Admin.jsx (our product unaltered), between lines 30-41, you will see that we initialize perfect-scrollbar on the tables as well.

Best, Manu