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 6698967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:38:23+00:00 2026-05-26T06:38:23+00:00

I am using jQuery UI Sortable widget for implementing drag and drop functionality in

  • 0

I am using jQuery UI Sortable widget for implementing drag and drop functionality in different rows of a table. I wish to change the id attribute of the row dragged (say row4) to that of the row that it displaces down(say row2). I can get the id of the object being dragged from the helper object that is passed to various callback functions, but how can I get the id of the row it finally displaces ?

There are certain rows between which some rows cannot be dragged and placed, and the check has been implemented using JavaScript which uses the id of the rows(and its various td*s*) to determine it. Its, therefore, very important that the ids of rows(and, consequently, its td*s*) reflect their new position.

  • 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-26T06:38:24+00:00Added an answer on May 26, 2026 at 6:38 am

    Here are some possible approaches:

    1. If the ids are consecutive you can just loop through the rows to create the new ids on drop callback.

    2. The row displaced will either be below or above when a drop is done. Therefore you should be able to use JQuery next() or perv() to get the old id for you current ‘drop’ position. As for how you know if you move up or down you can take a look here.

    3. Take a look at this it seem helpful.

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

Sidebar

Related Questions

i am using this jquery to make a drag and drop sortable list. http://jqueryui.com/demos/sortable/
I am using CodeIgniter with the jQuery UI Sortable widget, to change my menu
I'm using Jquery UI sortable in my current project to make boxes drag and
I have a table whose body I've made sortable using jQuery UI's Sortable function.
I have two HTML lists, and am using JQuery sortable to drag between them.
I'm using the jquery sortable functionality to sort a list of items in my
I have a table I'm using jQuery UI's sortable on. In the table, I
I'm using a jQuery UI sortable with a table (works fine). I would like
I have the following ListView in which I am using the JQuery UI sortable
I'm using the sortable function in jquery to sequence a faq list. Needless to

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.