I searched a few hours today for simple solutions, but I did not find it.
I have a table (# example) with data in it and with a link to a page (allinfo.php), where all the data of a certain row is shown (they are not all shown in the table). Therefore, I would like to make it easier for the user. I would like them to be able to click on the link and a dialog box with the contents of allinfo.php is shown.
my script in:
$(document).ready(function() { $('#example a').each(function() { var $dialog = $('<div></div>') .append($loading.clone()); var $link = $(this).one('click', function() { $dialog .load($link.attr('href') + ' #content') .dialog({ title: $link.attr('title'), width: 500, height: 300 }); $link.click(function() { $dialog.dialog('open'); return false; }); return false; }); }); $('#example').dataTable( { "bProcessing": true, "bServerSide": true, "bJQueryUI": true, "sAjaxSource": "url.php", "fnServerData": fnDataTablesPipeline, "sPaginationType": "full_numbers", } ); } );
So the problem is that the table is created in javascript, and I cannot add a dialog there. If I write somewhere else on the site: all the information and click, everything will work.
The only solution I see is with the onclick command, but I don't know how to use it?
therefore, the table should contain all the information
Thanks for the help!
source share