Closed GoogleCodeExporter closed 8 years ago
Hey Jeremy,
I had the same problem.
What happens the fist time you load it:
if (arguments.callee.done) return;
arguments.callee.done = true;
So if argument.callee.done isnt set(this is case when entering the first time),
it
continues the script, but first set the above member to true.
Because in the original case, only some div is replaced in the DOM (when using
AJAX), the other members/params are still there. a re-init of the object is
being
blocked by above line.
what you could do is comment out this line (so your dragtable.init(); restarts
the
process again, and is able to attach to the headers of the table), or pass a
param
to init() when doing a relaunch and then set set the argument.calle.done to
true; .
so:
init: function(blSecondHit) {
// Don't initialize twices
if(blSecondHit == true){
if (arguments.callee.done) return;
arguments.callee.done = true;
}
if (_dgtimer) clearInterval(_dgtimer);
if (!document.createElement || !document.getElementsByTagName) return;
alert('test4');
dragtable.dragObj.zIndex = 0;
dragtable.browser = new dragtable.Browser();
forEach(document.getElementsByTagName('table'), function(table) {
alert('hie ziet wel de tables');
if (table.className.search(/\bdraggable\b/) != -1) {
alert('hij ziet de class Draggable!!!');
dragtable.makeDraggable(table);
}
});
},
and then use dragtable.init(true);
Original comment by davidsluis1
on 15 Jul 2008 at 2:21
lol... I had my debug code still in it s: cleaned it up:
init: function(blSecondHit) {
// Don't initialize twices
if(blSecondHit == true){
if (arguments.callee.done) return;
arguments.callee.done = true;
}
if (_dgtimer) clearInterval(_dgtimer);
if (!document.createElement || !document.getElementsByTagName) return;
dragtable.dragObj.zIndex = 0;
dragtable.browser = new dragtable.Browser();
forEach(document.getElementsByTagName('table'), function(table) {
if (table.className.search(/\bdraggable\b/) != -1) {
dragtable.makeDraggable(table);
}
});
},
Original comment by davidsluis1
on 17 Jul 2008 at 7:59
The easiest way is:
dragtable.makeDraggable(table)
e.g.
var table = document.createElement("table");
...
dragtable.makeDraggable(table);
I've added a new example file in revision 13 that demonstrates this.
Original comment by danvdk
on 30 Jun 2009 at 8:49
Hello!
I'm adding new rows in draggable tables through Ajax.
So I tried to kill dragObj and reinit this without success.
My new rows in tables isn't draggable.
How can I solve it?
Help please!
Many thanks!
GV NN
Original comment by gvnn...@gmail.com
on 11 Sep 2009 at 9:12
Original issue reported on code.google.com by
jeremy.c...@gmail.com
on 10 Jul 2008 at 4:23