Problems with DRAG and DROP using Redpis

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 time Y can be dragged to any other column of X, but when making the change, I need to perform a subtraction count (x-y), so that's the problem.

I was able to set an event "event.dropped" from Redips, which always to DROPPAR a div on a td it 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 the td where the DIV was dropped, because I will be able to capture both the existing (X) and the droppada (Y) DIVS, do the calculations and replace the values .

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

    
asked by anonymous 26.08.2015 / 16:19

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);
};
    
27.08.2015 / 22:16