Problems with DRAG and DROP using Redpis

Asked

Viewed 59 times

1

I have an application that generates a gridView (ASP.NET) of information and in each column I can have 2 values. One of these values is the total working time (x) of a person for a specific date, and the other value is the working time (y) already planned for the person. The Y time can be dragged to any other column of X, but when making the change, I need to perform a subtraction account (x-y), there’s the problem.

I managed to define an event "Event.Dropped", Redips, that always to DROPPAR a div in a td he sends an Alert("test"):

redipsInit = function () {

var rd = REDIPS.drag,
    msg = document.getElementById('message');

rd.style.borderDisabled = 'solid';  
rd.style.opacityDisabled = 60;      
rd.init();

    rd.event.dropped = function () {
    var teste = 'Dropped';
    alert(teste);
    };
};

I need to somehow capture the value of td where the DIV was dropped, because there I will be able to capture the two DIVS, both the existing one (X), and droppada (Y), make the calculations and replace the values.

Does anyone know a solution? I don’t necessarily need a Redips solution, because I’m using it all together with . NET, so a solution . NET would also help. Vlw.

  • You want to take the value of td, not the id of the element you are including?

  • exactly, because td contains the value of the two DIV X and Y.

1 answer

0


I found something that solves!! Now I have the column references, before the modification and after the modification, which gives me the possibility to read the grid and get the values later.

var redipsInit;
var colClick01;
var colClick02;
var colDrop01;
var colDrop02;

redipsInit = function () {

rd.init();

rd.event.clicked = function () {
    var pos = rd.getPosition();
    colClick01 = pos[1];
    colClick02 = pos[2];
};

rd.event.dropped = function () {
    var pos = rd.getPosition();
    colDrop01 = pos[1];
    colDrop02 = pos[2];
    alert('Antes - linha =' + colClick01 + ', coluna =' + colClick02 + ' -- Depois - linha =' + colDrop01 + ', coluna =' + colDrop02);
};

Browser other questions tagged

You are not signed in. Login or sign up in order to post.