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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:34:22+00:00 2026-06-02T06:34:22+00:00

I have my primary grid dragging/dropping rows correctly into a secondary grid. My question

  • 0

I have my primary grid dragging/dropping rows correctly into a secondary grid. My question is, how do I perform a check just before the row is dropped into my secondary grid, which determines if the row I am attempting to drop is already there? If it is already there in the secondary grid, don’t let the user drop it there, basically stop the drag/drop function.

I’m thinking I can grab the key value from the row I am attempting to drop. Then, check to see if that value already exists as the key value in one of the rows I already dropped. I’m assuming I will have to use this function in some way:

beforedrop : function(e,ui,data,source,target) { }

OR this function:

ondrop: function (ev, ui, getdata) { }

Anyone have any ideas?

  • 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-02T06:34:25+00:00Added an answer on June 2, 2026 at 6:34 am

    The example of the usage could be about the following

    $("#grid1").jqGrid('gridDnD', {
        connectWith: '#grid2',
        beforedrop: function (ev, ui, getdata, $source, $target) {
            var names = $target.jqGrid('getCol', 'name2');
            if ($.inArray(getdata.name2, names) >= 0) {
                // prevent data for dropping
                ui.helper.dropped = false;
                alert("The row is already in the destination grid");
            }
        }
    });
    

    On the demo you would be unable to drop the rows “test1” from the first grid to the second one:

    enter image description here

    Other rows will be dropped without any problems.

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

Sidebar

Related Questions

I define a base class which have a Long primary key , just like
I'm using the 1140 grid system and have a basic question: Do you need
I have primary key of my row as hidden field in my jQGrid. It
I have a MySQL database with 60 tables. Most of the tables have primary
I have a primary key set up to auto increment. I am doing multiple
I have a primary link accommodation, then i have created a view , called
I have a primary table for Articles that is linked by a join table
Is It Possible to have a primary key and auto increment key associated to
Anybody have any ideas? The situation is like this: I have a primary rails
I have six tables, which unfortunately does not have any primary/foreign key-relations encoded. I've

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.