davicotico / jQuery-Menu-Editor

Multilevel Menu Editor for Bootstrap 4.x (Html & Javascript code)
https://davidticona.com/demos/jQuery-Menu-Editor/
MIT License
191 stars 86 forks source link

Custom fields #5

Closed dhcmega closed 6 years ago

dhcmega commented 6 years ago

Hi My menu uses another fields, like display_name, type, url (instead of href), it doesn't use target, for example. Is it possible to modify the field list without having to hack too much code? Is there an API to which I can pass the fields list? Thanks!

davicotico commented 6 years ago

Hi @dhcmega . Actually we can add extra fields, but we can not change the current fields: 'text' and 'icon' (these two fields are required in the source code). The fields 'href', 'target' & 'title'(for tooltip) have default values, so, they are always in the menu items. If you need add extra fields, add to the html form your input fields with a class="item-menu" like this:

<input type="text" class="form-control item-menu" id="type" name="type" placeholder="type">

I can consider your suggestion, but for now is very difficult cause my job is taking my time (and so much). Thanks for the feedback.

dhcmega commented 6 years ago

Hi @davicotico , tried but cannot adapt it. I think that for new version, it would be very nice to have more flexible fields, because it will allow for this package to be used in way more situations. Thanks!

davicotico commented 6 years ago

The first release will not include that feature. Maybe in a next version (more generic version) depending on the feedback received.

MarksEliel commented 3 years ago

I am using your plugin to generate forms, some fields are not necessary but they are still in JSON, it would be interesting that if they were not used, they would not be sent.