Topic: Table Editor unable to configure options for inputType select
Manuel Baust
priority
asked 2 weeks ago
I need help regarding configuration of a inputType Select column regarding options. Here's my config:
new TableEditor(table,
{
columns: [
{
label: 'Country',
field: 'country',
inputType: 'select',
editable: true,
options: [
{key: "1", value: "Germany"},
{key: "2", value: "USA"},
],
width: 100,
fixed: true,
sort: false
},
{
label: 'Revenue account',
field: 'revenue',
inputType: 'number',
editable: true
}
],
rows: [
{
country: "1",
revenue: 8400
}
]
},
{
bordered: false,
striped: false,
actionHeader: "ACTN",
actionPosition: 'start',
entries: 15,
entriesOptions: [15, 30],
fixedHeader: true,
mode: "inline",
rowsText: "RPP"
}
);
Actual Result:
<select><option value="[options Options]">[options Options]</option></select>
Expected Result:
<select><option value="1">Germany</option></select>
Manuel Baust
priority
answered 1 week ago
When inspecting the current table-editor code I found that currently there are only "strings" as options supported and no key/value pairs. I refactored the code a little bit to support strings and objects with key/value pairs. Here's my updated code of "editField.js" which is part of the table-editor plugin. Hopefully one of the official developers will merge this into a new version:
Snippet: https://mdbootstrap.com/snippets/standard/manuel-baustgmail-com/6429577
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 9.0.0
- Device: Any
- Browser: Any
- OS: Any
- Provided sample code: No
- Provided link: No