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

All fields not filled with json values #3

Closed emil126a closed 6 years ago

emil126a commented 6 years ago

I pass json like that:

[
   {
      "text":"Opcion2",
      "icon":"fa fa-bar-chart-o",
      "href":"http://home.com",
      "target":"_top",
      "title":"test2"
   },
   {
      "text":"Home",
      "icon":"fa fa-home",
      "href":"http://home.com",
      "target":"_blank",
      "title":"test1"
   }
]

What I want is to pass data first time when 'Edit' button is clicked. But when I click 'edit' button it does not add json values automatically to the 'target' and 'title' fields during page refresh. Or in other words "target" and "title" fields are always empty on first time 'edit' click.

emil126a commented 6 years ago

@davicotico

davicotico commented 6 years ago

@emil126a You are right. I am gonna to check the issue. Thanks for the feedback.

emil126a commented 6 years ago

You are welcome @davicotico . Let me know when you fix it. Thanx in advance.

davicotico commented 6 years ago

@emil126a The repo is fixed and updated with new features. The documentation is not updated yet. The demo is updated. Please rate the repository, that helps me a lot to show my work. I'm looking for a job. Have a good day.

emil126a commented 6 years ago

@davicotico I already rated. Thank you

emil126a commented 6 years ago

@davicotico , how can we add sort_order_number to json?

davicotico commented 6 years ago

Attributes can be added to item menu in the json. i.e. [{"text":"Home", "href": "#", ....."another" : "somevalue"}...] So, the form should be have an input with the name mnu_another (prefix 'mnu') I gonna to improve this feature. I am thinking to use a class="item-menu" instead of prefix **'mnu'** and include a public method to update the item from the form.

davicotico commented 6 years ago

@emil126a The updateItem method is restricted for now. Are allowed only attributes: text, icon, href, title, target. The next update are coming with improves about that.

davicotico commented 6 years ago

Right now the repository was updated with new methods and improves. The documentation is not updated yet. Please see the demo source code.

More flexibility for menu items: Attributes can be added to item menu in the json. i.e. [{"text":"Home", "href": "#", ....."another" : "somevalue"}...] So, the form should be have an input with the name "another" and the class="item-menu". All the inputs in the form should be have the class="item-menu". See the demo source code.

davicotico commented 6 years ago

Resolved issue.