Topic: Datatable Editor Plugin

NeoXP free asked 1 year ago


Expected behavior So I was working with Datatable Editor Plugin in Laravel and even tho i coded a workaround , there seems to be a error in the mdb libary. i provided you the code in the snippet. When i try to search in the table i get a error.

Actual behavior The Error in my console says: bootstrap:2 Uncaught TypeError: Cannot read properties of undefined (reading 'toString') at r (bootstrap:2:7) at Array.filter () at bootstrap:2:7 at Array.filter () at Ht (bootstrap:2:7) at o.get (bootstrap:2:7) at o.get (bootstrap:2:7) at o.get (bootstrap:2:7) at o.value (bootstrap:2:7) at o.value (bootstrap:2:7)

Resources (screenshots, code snippets etc.) https://mdbootstrap.com/snippets/standard/neoxp/5087319


Mateusz Lazaru staff answered 1 year ago


Before I'll report this as a bug let's try one thing. Add console.log(value) above this line:

value !== undefined &&
value.toString().toLowerCase().includes(searchValue)

Then check if there is any value which could cause the error. Anything not allowed to be converted into String.


NeoXP free commented 1 year ago

I was also wondering if i can make a field: hidden, i tried something like this, but i doesnt work: { width: -50, label: "Geburtstag", field: "geburtstag", sort: false, hidden: true },


Mateusz Lazaru staff commented 1 year ago

Unfortunately, there is no such option, but you can do that using extra css: https://mdbootstrap.com/snippets/standard/mlazaru/5100806#css-tab-view


NeoXP free answered 1 year ago


Alright if found the solution, it was actually the problem that i have to much meta data, when im getting the data from my mongodb collection, so i trimmed it, matching my advancedColumns the updated code: const tableInstance = new TableEditor( tableEditor, { rows: data.map((row) => { const newRow = {}; advancedColumns.forEach((col) => { const { field } = col; const value = row[field]?.trim() || ""; newRow[field] = value; }); newRow.contact =; return newRow; }), columns: advancedColumns, },



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

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 6.2.0
  • Device: Any
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: Yes