Table with expandable rows on demand

Hi.

I’d like to set up a page with a table, which starts with, say, 4 rows.

If a user clicks on the first row, below that line I should add the details which compose that row.

Say on row 1 I have total sales for group A. If I click on that row an ajax request is issued and then I need to populate the table with the details of the salesmen in group A.

Is there something Yii-specific I can use? Or I should look at jQuery alone?

Thanks

maxxer

There is no such a Yii widget, but it can achived with a bit of effort using ajax.

Take a look to CHtml::ajax and ajax link documentation, you should do an ajax request and retrive a row, wich can be added to your table.

same thing i too want have you got ansewer…if so, please post.i searched for last four days no use.please help i nthis

I populated the table dynamically. for each row I’ve made something like this:




$ret .= "<tr id=\"$rowid\" class=\"riga_$chiavefiglia\" ";

            if (isset ($chiavefiglia) && $chiavefiglia != "modello") { // End of loop

                $ret .= "onclick=\"if (showHide(this)) $.post('".

                        Yii::app ()->getController ()->createUrl ("fatturato/consegneProposte").

                        "',{data_inizio_ac:'$data_inizio_ac',data_fine_ac:'$data_fine_ac',".

                        "data_inizio_ap:'$data_inizio_ap',data_fine_ap:'$data_fine_ap',".

                        "divisione_mese:'$divisione_mese',tipo:'$tipo'";

$ret .= '},function(data){$(\'#'.$rowid.'\').after (data)})"';

$ret .= ">";



this way for every click on the table row I call via ajax the action ConsegneProposte into the Fatturato controller, and append the data just after. Data will contain full html of the row[s] to be added.