After deleting row with fancybox, get error (probably during fnDrawCallback)
After deleting row with fancybox, get error (probably during fnDrawCallback)
After deleting a row in DataTable, or calling redraw of server side after deleting a row in db that had fancybox links placed in by fnRender, get an error (see below).
I get the error even if I go to a different page after making the delete. Do you have any idea what's causing it?
[code]
// in intializer
"fnDrawCallback": function () {
$(".delete").fancybox({
//main.js:28Uncaught TypeError: Object [object Object] has no method 'fancybox'
'titlePosition' : 'top',
'overlayColor' : '#D03B40',
'overlayOpacity' : 0.4,
'transitionOut' : 'elastic',
'transitionIn' : 'elastic',
'height' : '65%',
'width' : '85%',
'scrolling' : 'auto',
'speedIn' : 500
});
},
"aoColumns": [
{ "sName": "QAid", "sType" : 'qaid', "sWidth": 80, fnRender: make_delete_link },
// ... more code here...
// make a link to delete an id's row in the database. oObj is defined as object passed to fnRender
function make_delete_link(oObj) {
var id = oObj.aData[0];
return id + " ";
}
[/code]
I get the error even if I go to a different page after making the delete. Do you have any idea what's causing it?
[code]
// in intializer
"fnDrawCallback": function () {
$(".delete").fancybox({
//main.js:28Uncaught TypeError: Object [object Object] has no method 'fancybox'
'titlePosition' : 'top',
'overlayColor' : '#D03B40',
'overlayOpacity' : 0.4,
'transitionOut' : 'elastic',
'transitionIn' : 'elastic',
'height' : '65%',
'width' : '85%',
'scrolling' : 'auto',
'speedIn' : 500
});
},
"aoColumns": [
{ "sName": "QAid", "sType" : 'qaid', "sWidth": 80, fnRender: make_delete_link },
// ... more code here...
// make a link to delete an id's row in the database. oObj is defined as object passed to fnRender
function make_delete_link(oObj) {
var id = oObj.aData[0];
return id + " ";
}
[/code]
This discussion has been closed.
Replies
If something is deleted on the server side while client's oTable has some reference to that row, fnDraw(true) and probably other functions crash.
if viewing in a different window (different oTable object) the fnDraw(true) worked fine although the first window performed a delete which affected the server side database on rows the second client had been viewing.
consequently, in that original client, no redraw, page changes, etc. will work.
in my work code, I am calling fancybox on a page that has a few tags, I think I'm overwriting jquery in memory and as a result no longer have .fancybox() routine. this is confirmed by me opening the fancybox popup, not doing any action, and still seeing the same side effects.
*whew*