Topic: Table Editor : How to prevent certain column display when editing?

linglecai free asked 2 years ago

Expected behavior

I want to remove display some column when editing rows because it has some customAction and includes html tags , it showed wrongly.

Actual behavior

cannot find a solution

Resources (screenshots, code snippets etc.)

const myProductsDatatableColumns = [
        label: '',
        field: 'customAction',
        editable: false,
        sort: false,

                    columns: myProductsDatatableColumns,
                    rows: => {
                        return {
                            customAction: `<a role="button" class="check_selection" id="${row.code}"Details</a>`,

How can I prevent the column with customAction to display when I click the 'edit' icon that Table Editor generate automatcally?

Grzegorz Bujański staff answered 2 years ago

At the moment, there is no such option. But you can do it yourself in a simple way:

tableEditor.addEventListener('edit.mdb.tableEditor', (e) => {
  setTimeout(() => {
    const disabledEl = tableEditor.querySelectorAll('input');
      disabledEl.forEach((el) => {
        if (el.disabled) {
 = 'none'

I prepared a snippet in which you can test it:

linglecai free commented 2 years ago

thanks very very much! I'll try to use in my project, and give u a feed back later.

linglecai free commented 2 years ago

it worked as expected, many thanks! by the way, i do have an advice on our website code example, that please consider to not use anonymous function or handler in offcial docs. Because that could trouble many starters(like me before) , it can easily cause reading obstacle and also behave wrongly for example : add multiple eventlistner.

thanks very much ,your answer works like a charm!

Grzegorz Bujański staff commented 2 years ago

Thank you for your feedback! We will consider it.

Please insert min. 20 characters.


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



Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 3.10.1
  • Device: PC
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No