MDBDataTableV5 Sorting Issue


Topic: MDBDataTableV5 Sorting Issue

Denzil asked 4 years ago

Hi,

Seems sorting is reset on component re-render. Tried both MDBDataTableV5 and MDBDataTable - same behaviour.

Component:

<MDBDataTableV5 small sortable responsive theadColor="blue lighten-5"
                                  entriesOptions={[10, 20, 50, 100]}
                                  entries={100} pagesAmount={4}
                                  data={datatable} order={['uptime', 'asc']} className="mx-auto"/>

and also here

    {
      label: 'Uptime %',
      field: 'uptime',
      sort: 'asc',
    },

Piotr Glejzer staff commented 4 years ago

I have questions about your problem. Are you updating data or saving in some locale storage, server, etc.?


Denzil commented 4 years ago

I use MeteorJS, reactive component, it uses React useEffect to re-render components on data changed. That is working perfectly fine for anything but datatable, for some reason. Here is some info about it https://blog.meteor.com/introducing-usetracker-react-hooks-for-meteor-cb00c16d6222

So in two words: data is in MiniMongo


Piotr Glejzer staff commented 4 years ago

I will try to find a solution for that. Thanks for the blog.


Denzil commented 4 years ago

Thanks. please, keep me posted. If you want to see it in action below: https://near-staking.com/stats wait up to 3 minutes and it data will be re-sorted.


Piotr Glejzer staff commented 4 years ago

I added the task about that because this took too much time for me to resolve it with a fast solution. Sorry about that.


Denzil commented 4 years ago

Ok, thanks, please keep up posted in the chat, when it fixed.


Amware commented 3 years ago

Any update on this it doesn't work for numbers or currency. MDBDataTableV5 can we get a progress update? There are no admin templates for V5 of MDB. Until then can we get a hotfix for this table pushed to V4 and merged to V4 Pro? Would be much appreciated.


Krzysztof Wilk staff commented 3 years ago

Hi!

We will add admin templates to the MDB5 React in the next release (22.11). We also will try to fix this issue in MDB4 but it is hard due to the complicated component structure :(

Keep coding!


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Open

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.27.0
  • Device: MacBook
  • Browser: Safari, Chrome
  • OS: Mac OS Catalina
  • Provided sample code: No
  • Provided link: No