Drag & Drop: Dropped Objects become [object HTMLTableCellElement]
Hi,
I am building objects with
- function oColumn(name, agg) {
this.name = name;
this.agg = agg;
this.toString = function() {
text = "";
text += "<div class='draggable' >";
text += '<p>' + this.name + '(' + this.agg + ')</p>';
text += "</div>";
return text;
}
}
Then I drag and drop these objects from one place to another
Actually the objects are transfered from one array into another array. These arrays are then used to refresh the corresponding tables.
I tracked down the error to the line
g_cols_oben.push(this);
After this in the array g_cols_oben_push is not my object but [object HTMLTableCellElement]
What am I doing wrong?
- <script>
$(function() {
$( ".draggable" ).draggable();
$( ".droppable" ).droppable({
drop: function( event, ui ) {
$( this )
.addClass( "ui-state-highlight" )
.find( "p" )
.html( "dropped!" );
//alert('droppend: ' + dir(this));
g_cols_oben.push(this);
g_cols_links.splice(this);
links();
oben();
}
});
});
</script>
BR
Tobias