After appending new row to table lose handler
Hello,
I've got a problem when I append a row to the table, the link in new <td> in probably not in jQuery Collection and I cant use jquery click or any action on it, just href go to url.
Maybe it will be more clear on my code :)
- $('table tr td a').each(function() {
- var $dialog = $('<div></div>').append($loading.clone());
- var $link = $(this).one('click', function() {
- $dialog.load($link.attr('href')).dialog({
- (...some code...)
- });
- $link.click(function() {
- $dialog.dialog('open');
- return false;
- });
- return false;
- });
- });
Above code open dialog when I click on the link i.e EDIT in every row in my table.
Now im tryin to add new row ie. like this:
- $('button#add').live('click',function() {
- $('table').append('<tr><td><a id="row170" href="news/edit/170.html">EDIT</a></td></tr>');
- return false;
- });
Till now it works, but when I link on this link in the new row it just open href in browser instead of openin dialog.
How to fix it?
Thanks in advance:)