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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:40:05+00:00 2026-05-26T21:40:05+00:00

I want to be able to drag items from Grid1 to Grid2 and then

  • 0

I want to be able to drag items from Grid1 to Grid2 and then allow the user to sort the items of Grid2. Individually, the sortableRows option and gridDnd options work without issue. When both integrations are used together and the user sorts the rows within Grid2, the rows are duplicated as if they were dragged from Grid1.

Using jquery 1.4.4, jqueryui 1.8.10, jqGrid 4.2
Here is some sample code demonstrating the issue:

<script type="text/javascript">
$(document).ready(function () {
    // Creating grid1
    jQuery("#grid1").jqGrid({
        datatype: "local",
        height: 100,
        colNames: ['Id1', 'Name1', 'Values1'],
        colModel: [
           {name: 'id1', index: 'id',width: 100}, 
           {name: 'name1',index: 'name',width: 100},
           {name: 'values1',index: 'values',width: 200}
        ],
        caption: 'Grid 1',
        pager: '#pgrid1'
    });

    // Creating grid2
    jQuery("#grid2").jqGrid({
        datatype: "local",
        height: 'auto',
        colNames: ['Id2', 'Name2', 'Values2'],
        colModel: [
           {name: 'id2',index: 'id',width: 100},
           {name: 'name2',index: 'name', width: 100},
           {name: 'values2',index: 'values',width: 200}],
        caption: 'Grid 2',
        pager: '#pgrid2'
    });

    // Data for grid1
    var mydata1 = [
        {id1:"1",name1:"test1",values1:'One'},
        {id1:"2",name1:"test2",values1:'Two'},
        {id1:"3",name1:"test3",values1:'Three'}
    ];

    // Data for grid2
    var mydata2 = [
        {id2:"11",name2:"test11",values2:'One1'},
        {id2:"21",name2:"test21",values2:'Two1'},
        {id2:"31",name2:"test31",values2:'Three1'}
    ];

    // Adding grid data
    for (var i = 0; i <= mydata1.length; i++) {
        jQuery("#grid1").jqGrid('addRowData',i + 1, mydata1[i]);
        jQuery("#grid2").jqGrid('addRowData',i + 1, mydata2[i]);
    }

    // connect grid1 with grid2
    jQuery("#grid1").jqGrid('gridDnD',{connectWith:'#grid2'});
    // make grid2 sortable
    jQuery("#grid2").jqGrid('sortableRows');

});

</script>
<table id="grid1">
    <tr>
        <td />
    </tr>
</table>
<table id="grid2">
    <tr>
        <td />
    </tr>
</table>
  • 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-26T21:40:05+00:00Added an answer on May 26, 2026 at 9:40 pm

    It seems a bug in the jqGrid code. I think that one should change the line 392 of the grid.jqueryui.js from

    return d;
    

    to

    return false;
    

    The corresponding line in the jquery.jqGrid.src.js has the number 11098. After the changes the original demo will be fixed to the following which seems work correct.

    UPDATED: I posted the bug report in the trirand forum where I described the problem and my suggestion to fix it. I hope that Tony will include the fix in the main code of jqGrid.

    UPDATED 2: The bug is already fixed in the main code of jqGrid.

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

Sidebar

Related Questions

I want that i should be able to drag items from jquery treeview that
I have a MovieClip that I want the user to be able to drag
I want to be able to drag and drag App model which is nested
I've got a grid of pictures that I want to be able to drag/drop
I want a user to be able to reorder a list on a click
I have some jquery code that i want to able to drag, drop, clone
Hey there, I would like to be able to drag an item (bookmark) from
I'm trying to be able to drag SVG elements (using Raphael) loaded from a
Greetings, I need to be able to drag and drop items that's contained in
I have two labels on a form. I want to be able to drag

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.