Web Component: j-ListMenuEditable
j-ListMenuEditable
Component for editable list menu
You can change CSS for your needs.
jComponent
v19|v20
Configuration:
iconremove
{String}
optional, changeremove
button icon. It's fontawesome icon withoutti-
part (default:times
)defaulticon
{String}
optional, changeedit
button icon (default:pencil-alt
)addicon
{String}
optional, will changeadd
button icon (default:plus-square
)placeholder
{String}
optional, a placeholder for input (default:Write text and press ENTER
)class
{String}
CSS class for selected item (default:selected
)title
{String}
optional, will add title on top of list menu (important if you want useaddicon
andaddclick
)key
{String}
optional, a defaultkey
fortext
value (default:name
)click
{String}
optional, action after click on item in menu. Path to function(element, index)addclick
{String}
optional, action after click onadd
button. Path to function() executes when user click onadd
iconeditclick
{String}
optional, action after click onedit
button. Path to function(element, index)
Methods:
component.add(object)
- This function will push object into path (can be null)component.edit(index)
- Function will enable edit on elementcomponent.remove(index)
- Function will remove the index
Good to know:
Path must be array of objects. After click on item in menu
Supports dynamic evaluation of the content of <script type="text/html">
. The example below contains a script with HTML and the component evaluates the content when the component is creating (only once).
<ui-component name="listmenueditable" path="tags">
<script type="text/html">
{{ if mycolor }}
<i class="ti ti-circle" style="color: {{ mycolor }}"></i>
{{ fi }}
{{ name }}
</script>
</ui-component>
Adding of custom class:
var opt = {};
opt.items = [];
opt.push({ name: 'Total.js', classname: 'your_class_name' });
Toggle editable:
var opt = {};
opt.items = [];
opt.push({ name: 'Total.js', editable: true });
Author
- Denis Granec info@totalavengers.com
- License
Created
07. june 2019
Updated
31. january 2023
jComponent library
19 | 20
Version
v1
License
https://www.totaljs.com/license/
Dark mode
Yes
Responsive
Yes
Author
Denis Granec
Email
info@totalavengers.com