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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:59:45+00:00 2026-05-31T14:59:45+00:00

Hi all: I met a problem like this. Here is the scenario: if I

  • 0

Hi all: I met a problem like this. Here is the scenario: if I have a database table A, which contains several columns, for example. Once the sever pass the database to web client, it’s rendered into a HTML table. Now, here is some requirements for the client side. The user will be able to add/delete several rows from the HTML table, in addition, they will also be able the change the row order. If we could finish the client side with the help from some jquery plugin (for example: http://www.isocra.com/2008/02/table-drag-and-drop-jquery-plugin/). Now, my question is, how could I pass this information back to server? Because there are new rows and deleted rows, the original table row order (like the plugin tableDnD.serialize function is not sufficient) is not enough.
How to do this?Please let me know if anyone have idea about that.I got stuck in it since 5 days.Thanking you in advance.

on drop row this javascript function is calling.

    this.onDrop = function(table, droppedRow) {
   // alert("ondrop1");
   var rows = this.table.tBodies[0].rows;
   var debugStr = "rows now: ";
   for (var i=0; i<rows.length; i++) {
       debugStr += rows[i].id+" ";
   //  alert(debugStr);
   }

// document.getElementById(‘debug’).innerHTML = ‘dropped
‘+debugStr;
}

now i have to send new position of row to server side.How to do 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-05-31T14:59:46+00:00Added an answer on May 31, 2026 at 2:59 pm

    Hi i think its better to use jquery ui to drag and drop purposes, they are very handy you can get details from this link

    i cant implement it right now but i think try using thse codes from thier site may give you some idea

    <script type="text/javascript">
      var table = document.getElementById('table-1');
      var tableDnD = new TableDnD();
      tableDnD.init(table);
    </script>
    

    try to use some alert in side this function may be more helpfull

    tableDnD.onDrop = function(table, row) {
        var rows = this.table.tBodies[0].rows;
        var debugStr = "rows now: ";
        for (var i=0; i<rows.length; i++) {
            debugStr += rows[i].id+" ";
        }
    
        document.getElementById('debug').innerHTML = 'row['+row.id+'] dropped<br>'+debugStr;
    }
    

    if you got the desired data from this writa an ajax operation in a function and call it from this function or call it on a buttons click event to save data

    here is a link to ajax tutorial of w3 schools have a refrence,

    suppose your function is ajaxcall() then

    function ajaxcall(readedValue)  { 
        var xmlhttp;
        if (window.XMLHttpRequest) {
            // code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp=new XMLHttpRequest();
        } else {
            // code for IE6, IE5
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
    
        xmlhttp.onreadystatechange=function()  {
            if (xmlhttp.readyState==4 && xmlhttp.status==200)  { 
                var returnreslut=xmlhttp.responseText;
                if(returnreslut==true){
                    alert("Sucess");           
                } else  {
                    alert("failed");
                }
            }
        }
    
        xmlhttp.open("POST","insertQueryPage.jsp",true);
        xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
        xmlhttp.send("value="+readedValue);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

You have all met this scenario. I am using a new algorithm for the
I have a table with something like a dozen different columns. Is there a
I have an article controller, which manages all article relations like authors, translations, related
I have a library which contains all font characters (Arial in my case). For
Following the guide here, I have created a full-screen WPF application. But I met
I have a list of questions in a table, some of which are only
I met a problem. I had a server which is installed redhat enterprise 5.5.
I have a problem. I have a table of support tickets (wh_task). Each task
(I have a workaround for this problem, but it's not the first time I've
Have you ever encountered a situaton like this, and if so, how did you

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.