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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:49:40+00:00 2026-05-29T09:49:40+00:00

I have requirements to prompt the user for confirmation when dragging and dropping a

  • 0

I have requirements to prompt the user for confirmation when dragging and dropping a row between grids. Currently I am trying to assign a class of ‘acceptable’ to the row if the confirmation is yes and then set the drop_opts to only accept that class. Below is my connection declaration and function for confirmation, I have excluded the code for the rest of the grid as it is not necessary.

$('#MyGrid').jqGrid('gridDnD', { 
connectWith: '#MyGrid2',
onstart: function(evt, ui) {onjqstart(evt, ui)},
drop_opts: { accept: function(el) { return el.hasClass('acceptable'); } }


function onjqstart(evt, ui) {
    var tmp = confirm("Drop it?");
    if (tmp) {
        $(ui.helper).addClass('acceptable');
    }
}

For the accept function it looks like the ‘el’ variable is a container that is used to hold the draggable row, so it obviously will not have my class added to it and that container does not exist or is not available in my onjqstart event. So any suggestion on how to assign the class to the correct element or a better way to attempt this would be greatly appreciated.

  • 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-29T09:49:42+00:00Added an answer on May 29, 2026 at 9:49 am

    I figured out how to do this one. It works out better to use the before drop function. In that function if the user declines the drop it is as simple as setting dropped to false.

    $('#MyGrid').jqGrid('gridDnD',{
    connectWith: '#MyGrid2',
    beforedrop: function(evt, ui, data, source, target) {beforejqdrop(evt, ui, data, source, target)},
    ondrop: function(evt, ui, data) {onjqdrop(evt, ui, data)},
    dropbyname: 'False',
    droppos: 'first',
    autoid: 'True',
    autoidprefix: 'dnd_',
    dragcopy: 'False'});
    
    function beforejqdrop(evt, ui, data, source, target) {
        if (!confirm('is it ok to drop it?')) {
            ui.helper.dropped = false;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have received requirements that ask to normalize text box content when the user
I am trying to do an assignment for class, but I have run into
I have requirements to establish a CMS system for enterprise and it has to
Here I have 2 requirements: Need a batch file to start a process on
I have some credential requirements for my modules in security.yml. How can i run
Requirements : I have a table of several thousand questions. Users can view these
I have the following requirements I have relational content stored in a SQL Server
i have two opposing requirements related to an xml document and its related xsd.
I have some business requirements which sound something like this: Find the data in
Here are my requirements: I have a DIV which should display an image (JPEG).

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.