lwen priority asked 2 months ago


Need help to configure source code using table editor. Copied and testing the sample, on console log show an error:

Uncaught TypeError: mdb.Select is not a constructor

<!DOCTYPE html>

Test

<script src="/js/bootstrap.bundle.js"></script>
<script type="text/javascript" src="/js/mdb.umd.min.js"></script>
<script type="text/javascript" src="/js/all.min.js"></script>
<script src="/js/jquery-3.3.1.min.js"></script>

Search


const advancedColumns = [ { width: 250, label: 'Empresa', field: 'Empresa', sort: false, }, { width: 250, sort: false, defaultValue: 'Warsaw', options: ['London', 'Warsaw', 'New York'], inputType: 'select', label: 'Office', field: 'office', }, { width: 250, inputType: 'number', defaultValue: 1, label: 'Employees', field: 'employees', }, { width: 100, defaultValue: false, inputType: 'checkbox', label: 'International', field: 'international', }, ]; const advancedRows = [ { Empresa: 'Smith & Johnson', office: 'London', employees: 30, international: true, }, { Empresa: 'P.J. Company', office: 'London', employees: 80, international: false, }, { Empresa: 'Food & Wine', office: 'London', employees: 12, international: false, }, { Empresa: 'IT Service', office: 'London', employees: 17, international: false, }, { Empresa: 'A. Jonson Gallery', office: 'London', employees: 4, international: false, }, { Empresa: 'F.A. Architects', office: 'London', employees: 4, international: false, }, ]; const table = document.getElementById('tabela'); new TableEditor(table, { rows: advancedRows, columns: advancedColumns }); table.addEventListener('add.mdb.tableEditor', (e) => { const alert = document.getElementById('alert-add-entry'); const alertInstance = mdb.Alert.getInstance(alert); const { company, office } = e.row; alert.innerHTML = 'Incluir: ${company} (${office})'; alertInstance.show(); alert('add'); }); table.addEventListener('delete.mdb.tableEditor', (e) => { const alert = document.getElementById('alert-remove-entry'); const alertInstance = mdb.Alert.getInstance(alert); const { company, office } = e.row; alert.innerHTML = `Deleted entry: ${company} (${office})`; alertInstance.show(); alert('remove'); }); table.addEventListener('update.mdb.tableEditor', (e) => { const alert = document.getElementById('alert-update-entry'); const alertInstance = mdb.Alert.getInstance(alert); const { company, office } = e.row; alert.innerHTML = `Updated entry: ${company} (${office})`; alertInstance.show(); alert('alter'); });

Grzegorz Bujański staff commented 2 months ago

Unfortunately, I am unable to reproduce this error. Can you create a snippet in which this error will appear? Where are you adding this JS code? Directly in the html file in the script tag or in a separate JS file?


lwen priority answered 2 months ago


Solved. The solution was to put .js in the end of html



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: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 7.1.0
  • Device: desktop
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No