Giter VIP home page Giter VIP logo

Comments (9)

mechanicious avatar mechanicious commented on September 8, 2024

Thank you for your message. Please consider providing enough data for me to exactly replicate the possible bug which will enable me to look into it.

Note that after removing a child item (by clicking the delete button), you're not able to place it into same level as the parent anymore since the item has already been removed.

from domenu.

shakyapranin avatar shakyapranin commented on September 8, 2024

Glad you replied.I also have edited my issue. NOTE: I have added an extra field named "tagline"
My issue can be replicated by following the steps below:
The pic below shows the initial state of the menu and json data
initialmenu
JSON 1:

 [{"title":"About Us","url":"http://demourl/about_us","tagline":"demo tagline","children":[{"title":"Services","url":"http://demourl/services","tagline":"asdf"}]},{"title":"Portfolio","url":"http://demorul/portfolio","tagline":"asdfa"},{"title":"Contact Us","url":"http://demourl/contact","tagline":"asdfads"}]

Step 1:
Move an item to create sub menu
moveintoaparent
JSON 2:

[{"title":"About Us","url":"http://demourl/about_us","tagline":"demo tagline change abt us","children":[{"title":"Services","url":"http://demourl/services","tagline":"asdf"}]},{"title":"Portfolio","url":"http://demourl/portfolio","tagline":"asdfa"},{"title":"Contact Us","url":"http://demourl/contact","tagline":"asdfads"}]

After making the above changes I stored the json record in the database.
Then again i retrieve records and my json data is the same as JSON 2. It renders fine when i pass it in $('#domenu').domenu({data: menuData}).parseJson();

Now the problem arises when i perform the next step

Step 3:
I moved the child back to its original position.
backtoinitialstate

Now the json data is
JSON 3:

[{"title":"About Us","url":"http://demourl/about_us","tagline":"demo tagline change abt us","children":[{"title":"Services","url":"http://demourl/services","tagline":"asdf"}]},{"title":"Services","url":"http://demourl/services","tagline":"asdf"},{"title":"Portfolio","url":"http://demourl/portfolio","tagline":"asdfa"},{"title":"Contact Us","url":"http://demourl/contact","tagline":"asdfads"}]

NOTICE how services data is still persisting as a child even after moving the element.
Now this JSON Data will yield a menu as follows on rendering.
flaseresult

Finally:
You may also see in the first pic how the about us bears a "-" sign even if it doesn't have any children.This is most probably caused by ("children":) in the JSON 1 as i had previously created its child element and later moved/removed it.

THANK YOU AGAIN FOR THIS GREAT PLUGIN ENHANCEMENT AND HOPE TO HEAR SOON FROM YOU,CHEERS!!!

from domenu.

mechanicious avatar mechanicious commented on September 8, 2024

Hi thank you for your wonderful description of the problem, I was successfully able to replicate this problem and I've recognized it as a bug. I will patch this as soon as possible. Also, the ghost-child ('-' sign on empty parents) has already been solved in the next version of doMenu, which is about to get released soon.

from domenu.

mechanicious avatar mechanicious commented on September 8, 2024

Hi, this bug has been patched in the dev-version of the plugin. I will release the patched version to the public when I complete writing the release notes, however you can use the patched version right now if you're able to figure it out yourself how to use it (there is a working demo available and the files contain instructions in the comments). Please confirm the validity of the patch on your side, if possible.

from domenu.

shakyapranin avatar shakyapranin commented on September 8, 2024

Hi,it's me again.I integrated the developer version of your plugin and it does not work with JSON data i have mentioned above(NOTE: IT WORKS with the JSON data from the DEVELOPER VERSION).I would like to ask why you have added an "id" field for your items, I presume you used some logic identifying unique items to solve the child duplication issue.I also tried using the code below to add the unique id:
/</ input type="hidden" name="id" data-default-value="{?numeric.increment}" />/

But the problem here is it yields a string value and your plugin expects "id" field to be numeric I suppose.

THE STATIC JSON DATA YOU PASSED IN THE DEVELOPER DEMO IS:

[
  {
    "id": 11,
    "title": "Flat Glass Preview",
    "http": "",
    "superselect": "2"
  },
  {
    "id": 10,
    "title": "News",
    "http": "",
    "superselect": "1"
  },
  {
    "id": 9,
    "title": "Categories",
    "http": "",
    "superselect": "1"
  },
  {
    "id": 6,
    "title": "Shop",
    "http": "",
    "children": [
      {
        "id": 5,
        "title": "Glass",
        "http": "",
        "superselect": "1"
      },
      {
        "title": "Other",
        "superselect": "select something..."
      }
    ],
    "superselect": "select something..."
  },
  {
    "id": 1,
    "title": "About",
    "http": "",
    "superselect": "select something..."
  }
]

THE JSON DATA I'm able to yield by adding the hidden input mentioned above is:

[
  {
    "title": "Item no. 3",
    "tagline": "",
    "id": "1",
    "superselect": "http://demourl/portfolio/17"
  },
  {
    "title": "Item no. 2",
    "tagline": "",
    "id": "2",
    "superselect": "http://demourl/portfolio/17",
    "children": [
      {
        "title": "Item no. 1",
        "tagline": "",
        "id": "3",
        "superselect": "http://demourl/portfolio/17"
      }
    ]
  },
  {
    "title": "Item no. 1",
    "tagline": "",
    "id": "3",
    "superselect": "http://demourl/portfolio/17"
  },
  {
    "id": "4",
    "title": "Item no. 0",
    "http": "",
    "superselect": "http://demourl/portfolio/17",
    "tagline": ""
  }
]

You may notice how the "id" values are string, so the child duplication problem still persists.

I really appreciate your help and I am thankful for the enhancement of custom fields I suggested.Cheers!!

from domenu.

mechanicious avatar mechanicious commented on September 8, 2024

Hi thank you for your reply. Note that the id property is added by default
without any explicit inputs in your blueprint. Please make sure to create a
correct blueprint template in your html markup (default
".dd-item-blueprint"). Also note that this standard id field is present in the previous versions as well.

On Sun, Nov 1, 2015 at 9:27 AM, Praneen Shakya [email protected]
wrote:

Hi,it's me again.I integrated the developer version of your plugin and it
does not work with JSON data i have mentioned above(NOTE: IT WORKS with the
JSON data from the DEVELOPER VERSION).I would like to ask why you have
added an "id" field for your items, I presume you used some logic
identifying unique items to solve the child duplication issue.I also tried
using the code below to add the unique id:
/</ input type="hidden" name="id"
data-default-value="{?numeric.increment}" />/

But the problem here is it yields a string value and your plugin expects
"id" field to be numeric I suppose.

THE STATIC JSON DATA YOU PASSED IN THE DEVELOPER DEMO IS:
[
{
"id": 11,
"title": "Flat Glass Preview",
"http": "",
"superselect": "2"
},
{
"id": 10,
"title": "News",
"http": "",
"superselect": "1"
},
{
"id": 9,
"title": "Categories",
"http": "",
"superselect": "1"
},
{
"id": 6,
"title": "Shop",
"http": "",
"children": [
{
"id": 5,
"title": "Glass",
"http": "",
"superselect": "1"
},
{
"title": "Other",
"superselect": "select something..."
}
],
"superselect": "select something..."
},
{
"id": 1,
"title": "About",
"http": "",
"superselect": "select something..."
}
]

THE JSON DATA I'm able to yield by adding the hidden input mentioned above
is:
[
{
"title": "Item no. 3",
"tagline": "",
"id": "1",
"superselect": "http://demourl/portfolio/17"
},
{
"title": "Item no. 2",
"tagline": "",
"id": "2",
"superselect": "http://demourl/portfolio/17",
"children": [
{
"title": "Item no. 1",
"tagline": "",
"id": "3",
"superselect": "http://demourl/portfolio/17"
}
]
},
{
"title": "Item no. 1",
"tagline": "",
"id": "3",
"superselect": "http://demourl/portfolio/17"
},
{
"id": "4",
"title": "Item no. 0",
"http": "",
"superselect": "http://demourl/portfolio/17",
"tagline": ""
}
]

You may notice how the "id" values are string, so the child duplication
problem still persists.

I really appreciate your help and I am thankful for the enhancement of
custom fields I suggested.Cheers!!


Reply to this email directly or view it on GitHub
#4 (comment).

from domenu.

shakyapranin avatar shakyapranin commented on September 8, 2024

Thank you for your reply. I had previously used the blue print template from your demo and have also reviewed it. I noticed that ADDING NEW MENU ITEMS THROUGH "+" button WONT yield "id" property while going through the JSON.
So i edited the JSON from your developer demo as

[
  {
    "title": "Flat Glass Preview",
    "http": "",
    "superselect": "2"
  },
  {
    "title": "News",
    "http": "",
    "superselect": "1"
  },
  {
    "title": "Categories",
    "http": "",
    "superselect": "1"
  },
  {
    "title": "Shop",
    "http": "",
    "children": [
      {
        "title": "Glass",
        "http": "",
        "superselect": "1"
      },
      {
        "title": "Other",
        "superselect": "select something..."
      }
    ],
    "superselect": "select something..."
  },
  {
    "title": "About",
    "http": "",
    "superselect": "select something..."
  }
]

This then replicated the child duplication error.Thank you for your time.

from domenu.

mechanicious avatar mechanicious commented on September 8, 2024

Thank you for your reply. Please check the patch I've just pushed on the dev branch, and confirm its validity.

from domenu.

shakyapranin avatar shakyapranin commented on September 8, 2024

Thank you !! The latest patch solved the problem for me.

from domenu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.