generate CGridView based dynamic selection in Dropdownlist

Hi Guys,

How to generate CGridView result based on dropdownlist selection? Pls give me some example or link can be useful to me… Thanks =)


  <?php echo $form->labelEx($model, 'company'); ?>

        <?php echo $form->dropDownList($model, 'company', $model->getCompanyOptions()); ?>

         <?php echo $form->error($model, 'company'); ?> 


public function getCompanyOptions()

    {

        return

        CHtml::listData(company::model()->findAll(), 'id', 'name');

    }


          

    $this->widget('zii.widgets.grid.CGridView', array(

        'id' => 'detail-grid',

        'dataProvider' => $dataProvider,

        




$this->widget('zii.widgets.grid.CGridView', array(

    'id' => 'detail-grid',

    'dataProvider' => $dataProvider,

    'filter' =>$model,

    'columns' => array(

        array(

            'name' => 'companyId',

            'value' => '$data->company->name',

            'filter' => CHtml::listData(Company::model()->findAll(), 'id', 'name')

        )

    )

);



Hi guys,

I now create a view where user can pick the company name based on form dropdownlist selection. After click button, the CGridView will show the company info based on company name that user’s selection. Pls give me some example or link. thanks. =)

The code below is just let user filter the company info inside the CGridView.


$this->widget('zii.widgets.grid.CGridView', array(

    'id' => 'detail-grid',

    'dataProvider' => $dataProvider,

    'filter' =>$model,

    'columns' => array(

        array(

            'name' => 'companyId',

            'value' => '$data->company->name',

            'filter' => CHtml::listData(Company::model()->findAll(), 'id', 'name')

        )

    )

);

hi guys,

I now create a CGridView where user can pick the company name based on form dropdownlist selection. After click button, the CGridView will show the company info based on company name that user’s selection.

How to show the company info in CGridView after user select the company name in dropdownlist options. What i need to do to render the dropdownlist result to CGridView. Pls help me, give me some example or link. I still a newbie.


 <?php echo $form->labelEx($model, 'company'); ?>

        <?php echo $form->dropDownList($model, 'company', $model->getCompanyOptions()); ?>

         <?php echo $form->error($model, 'company'); ?>




public function getCompanyOptions()

    {

        return

        CHtml::listData(company::model()->findAll(), 'id', 'name');

    } 

Teeing the ball as well small will influence your playing golf gain by creating you swing movement straight down in a steeper position which also can lower the range of the drive.it could also get away from your clubhead which has a somewhat available encounter at influence leading to a slice as a part of your playing golf shot.