renderAjax tags missing from output

Ive got a weird query that hopefully someone can shed some light on.

Im trying to dynamically add rows to a form so the user can enter 1…x entries. The rows will use a default field to check to see if a row already exists with the same values using a Jui\AutoComplete. The form starts with 1 row in a table structure. When user clicks add row button an ajax call is made an a partial template is loaded as a new row into the table tbody section. This is where the weirdness starts.

If i use renderPartial from the controller the partial view in its entirety is loaded into the table in correct place and the javascript for the AutoComplete doesnt work (as expected).

If i use renderAjax from the controller the partial view is loaded into the table in correct place and the javascript for the AutoComplete does work (as expected) but the tr/td tags are missing, i only get the input tags.

so to sum up, when using renderPartial i get the full template i.e.

<tr><td><input…></td><td><input…></td></tr>

so to sum up, when using renderAjax i get only the inputs from the template i.e.

<input…><input…>

Anyone know why this is? Is Yii parsing out the incorrectly formatted HTML as its treating it as a full page render and if so is there any way to do a renderAjax in a partial way?

Thanks

Ross

Ok so it does actually return the tr tags in the ajax response but they dont get added correctly to the page. Im assuming this is because it comes as:


<link href="/assets/fe124ae2/themes/smoothness/jquery-ui.css" rel="stylesheet">

<tr>

And the browser doesn’t like this. If i use a full table it works fine. Makes it very difficult to add a row to a table dynamically that requires javascript