Table sort - Javascript Error


Topic: Table sort - Javascript Error

sintacs asked 6 years ago

I used the example code from https://mdbootstrap.com/content/bootstrap-table-sort/ with the latest MDB-Free version on this url *removed* and I get this js-error when I click on a table-head to sort: Uncaught TypeError: Cannot create property 'length' on boolean 'true' at _fnSortListener (datatables.js:6176) at datatables.js:6225 at HTMLTableCellElement.<anonymous> (datatables.js:6596) at HTMLTableCellElement.dispatch (jquery-3.3.1.min.js:2) at HTMLTableCellElement.y.handle (jquery-3.3.1.min.js:2) I think I am missing something but I can't figure out what.      

giorgio.ponza pro premium priority answered 6 years ago

Hi, in the DataTable options there is a mistake. You specified "sorting"=true but you should use "ordering"=true as in the official documentation With the parameter "order" you can define which column(s) the order is performed upon, and the ordering direction (documentation)

sintacs commented 6 years ago

Thank you, that fixed it. I think the tutorial should be changed reflecting this issue.

Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.5.10
  • Device: PC
  • Browser: Chrome, Firefox
  • OS: Win 7
  • Provided sample code: No
  • Provided link: Yes