Shadowbox with server-side script
Shadowbox with server-side script
Hello,
I have one problem with shadow box with server-side script.
I should retrive a big amound of data from database, and shuold have a link, which I prefered that it's opened throught shadowbox script.
When I write the link in to page it works great, but when I create a server-side script, and return the same link (with shadow box) it's don't work.
In parent document I use:
[code]
Shadowbox.init();
[/code]
In server side script I use this:
[code]
$row[2] = "$link";
[/code]
But if I write the link in parent document it's work:
[code]
echo "link";
[/code]
But if I try from server-side script, it's don't work :(
May bee you could help me?
Thank you
I have one problem with shadow box with server-side script.
I should retrive a big amound of data from database, and shuold have a link, which I prefered that it's opened throught shadowbox script.
When I write the link in to page it works great, but when I create a server-side script, and return the same link (with shadow box) it's don't work.
In parent document I use:
[code]
Shadowbox.init();
[/code]
In server side script I use this:
[code]
$row[2] = "$link";
[/code]
But if I write the link in parent document it's work:
[code]
echo "link";
[/code]
But if I try from server-side script, it's don't work :(
May bee you could help me?
Thank you
This discussion has been closed.
Replies
Allan
Thank you
I only needed, that when datatables config a table, show a link, witch opened in shadowbox.
I'll try write fnDrawCallback but it's still doesn't work :(
Please help me :)
[code]
function startas()
{
$('#example tbody tr').live('click', function() {
var aData = oTable.fnGetDate( this );
var id = aData[2];
alert( id );
//shadowbox(id);
});
}
function shadowbox(linkas)
{
location.href=linkas + 'html' + ' rel="shadowbox;width=1000;height=800"';
}
[/code]
and
[code]
"fnDrawCallback": function() { startas(); },
[/code]
but and this doesn't work :(
[code]
var oTable = $('#example').dataTable( {
"sDom": 'TC<"clear">lfrtip',
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "auditas_ajax.php",
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull )
{
$('td:eq(2)', nRow).html( ''+aData[2]+'' );
},
[/code]
[code]
//shadowbox initializing
Shadowbox.setup($('.sbox'));
$('a.sbox').live('click', function(e) {
Shadowbox.open(this);
e.preventDefault();
});
//datatables
var oTable = $('#example').dataTable( {
"sDom": 'TC<"clear">lfrtip',
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "auditas_ajax.php",
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull )
{
$('td:eq(2)', nRow).html( ''+aData[2]+'' );
},
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 0 ] },
{ "bSortable": true, "aTargets": [ 1 ] },
{ "bSortable": false, "aTargets": [ 22 ] },
{ "bVisible": false, "aTargets": [ 3 ] },
{ "bVisible": false, "aTargets": [ 4 ] },
{ "bVisible": false, "aTargets": [ 5 ] },
{ "bVisible": false, "aTargets": [ 6 ] },
{ "bVisible": false, "aTargets": [ 7 ] },
{ "bVisible": false, "aTargets": [ 8 ] },
{ "bVisible": false, "aTargets": [ 9 ] }
],
"aaSorting": [[1, 'asc']]
});
[/code]
And it's work perfect, how I understand the shadow box should initializing a leter than datatables.