Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7920885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:22:52+00:00 2026-06-03T16:22:52+00:00

I have specific troubles when I try create node. From context menu everything gona

  • 0

I have specific troubles when I try create node. From context menu everything gona be OK, but when I call create event from button I don’t have AJAX request.

Look:

    bind("create.jstree", function (e, data) {
    console.log('creating');

    $.ajax({
        type: 'post',
        url: '/item/add',
        data: {
            name:  data.rslt.name,
            id_menu_content_parent: data.rslt.parent.attr("id").replace("node_",""),
            id_type_object: data.rslt.obj.attr("rel")
        },
        success: function (dataItem){
        }
    });
    console.log('end');
});

And now when I call from context menu is OK, I see sting creating, next AJAX request and finally string end, but when I click the button I see only string creating and nothing more.

What should I do with this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T16:22:55+00:00Added an answer on June 3, 2026 at 4:22 pm

    The most likely reason that your create works when invoked from your context menu but not when invoked with a button is that for your context menu, you probably have a tree node selected when the create callback is invoked. However, when you invoke the create callback from a button, you might not necessarily have a node selected. This will most likely cause your $.ajax call to fail because it tries to reference undefined properties. Specifically, data.rslt.parent.attr("id") will fail because if you do not have a node selected, your new node will be created at the parent level and thus data.rslt.parent will have a value of -1. This should explain why you are not seeing your console.log('end') output.

    From your question I’m guessing you are not using the debugger to debug your javascript. If you are going do be doing any sort of serious development, you can not rely on printf style debugging, espeically since your browser probably has a javascript debugger already. If you ran your code through the debugger, you will be able to immediately see what caused the problem in your post. It might take you a while to learn to use the debugger effectively, but it will save you much more time down the road and help you write better code.

    BTW I recommend that you debug your code either in FireFox with Firebugs or Chrome since these two browsers offer good development tools.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a specific case in mind, but the question applies in general too.
I'm trying to use auto-generated forms in symfony, but I have troubles finding good
Some specific situation: I have two Activities . FirstActivity loads data from network(~100 kb)
I have a specific requirement that all children of a particular JComponent have double
I have a specific question, that could use a general answer... When building Multi-Tier
I have a specific DB2 query, and I would like to execute this query
I have some specific id like 1,2,5,11,64589 in solr (int type) I want to
I have a specific Silverlight application, that is fed with data by a WCF-Service.
I have a specific object with image data. And I want read/write images (in
I have a specific information in a table I am looking for, this query

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.