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

  • SEARCH
  • Home
  • 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 5928729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:19:35+00:00 2026-05-22T14:19:35+00:00

We are using jstree for representing the folder and file structure in our web

  • 0

We are using jstree for representing the folder and file structure in our web application. When I move a file from one folder to another folder using drag and drop plugin of jstree, we need to know the folder from which it was moved.

How can we do this?

Below is my code.

<ul>
<li id="phtml_0" rel="root" class="open">
    <a href="#"><ins>&nbsp;</ins></a>
    <ul>
        <li id="phtml_1" rel="folder"> <a><ins>&nbsp;</ins>Folder 1</a></li>
        <li id="phtml_2" rel="folder"> <a><ins>&nbsp;</ins>Folder 2</a>
            <ul>
                <li id="phtml_11" rel="file"><a href="#"><ins>&nbsp;</ins>File 1</a></li>
                <li id="phtml_22" rel="file"><a href="#"><ins>&nbsp;</ins>File 2</a></li>
            </ul>
        </li>
        <li id="phtml_3" rel="folder"> <a><ins>&nbsp;</ins>Folder 3</a></li>
</ul>

In above case I have three folders i.e. Folder 1, Folder 2 and Folder 3.

Folder 2 has two files i.e. File 1 and File 2.

When File 1 is moved from Folder 2 to Folder 3, I need a way to find out that it was moved from Folder 2.

Basically I will need the id’s of the li element of the containing folder, e.g. for File 2 (when it is moved from Folder 2), I will need the value phtml_2. (2 is the id of the Folder)

Please help.

  • 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-05-22T14:19:35+00:00Added an answer on May 22, 2026 at 2:19 pm

    This worked for me draggedObject.parent().parent().attr(‘id’);

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

Sidebar

Related Questions

Silly question. A lot of examples using jstree that I find on the web
I'm using jstree plugin altogether with filament group buttons on the web page. I
I am using the latest jstree commit from github with the checkbox plugin as
I am using jsTree to display a tree structure of hierarchical data within my
I am using jstree for a tree view in a web page. The tree
I want to write an application using jsTree that would display and manipulate directory
I have downloaded the files from jstree home downoad link. i am already using
I am trying get tree view in the web page. I am using jstree
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
Using JDeveloper , I started developing a set of web pages for a project

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.