TbEditable not working on dynamically added elements


A cloned row in a table is not binding to TbEditableField events.

I have a table with multiple rows and columns of which many contain the yiibooster TbEditable widget.

The user can add a new row by clicking a link which clones the last row and adds it to the bottom of the table, this all works fine.

I have used the "true" parameter with clone (.clone(true)) to copy the events and data into the new row however I am not seeing the Editable dialog when I click an editable cell in the new row.

Here is the code that creates the new row.

$(".addrow").on("click", function() 


    var grid = $(this).attr("data-grid");

    var lastrow = $(grid).find("tbody").find("tr:last");

    var lastcopy = $(lastrow).clone(true);


    return false;


There are no "id"s in any of the copied elements that need changing.

If I check the new elements with Firebug in Firefox, it shows that events are attached, same as the existing row. In one column where I do not have an editable field but an image that toggles when its clicked, that is working fine in the new row.

Is anyone able to help me work out how to get the TbEditableField events working for the new row?

Thanks in advance.

Greg J