• <bdo id='H3bBA'></bdo><ul id='H3bBA'></ul>
  1. <tfoot id='H3bBA'></tfoot><legend id='H3bBA'><style id='H3bBA'><dir id='H3bBA'><q id='H3bBA'></q></dir></style></legend>
      <i id='H3bBA'><tr id='H3bBA'><dt id='H3bBA'><q id='H3bBA'><span id='H3bBA'><b id='H3bBA'><form id='H3bBA'><ins id='H3bBA'></ins><ul id='H3bBA'></ul><sub id='H3bBA'></sub></form><legend id='H3bBA'></legend><bdo id='H3bBA'><pre id='H3bBA'><center id='H3bBA'></center></pre></bdo></b><th id='H3bBA'></th></span></q></dt></tr></i><div id='H3bBA'><tfoot id='H3bBA'></tfoot><dl id='H3bBA'><fieldset id='H3bBA'></fieldset></dl></div>

      <small id='H3bBA'></small><noframes id='H3bBA'>

      Yii cgridview ajaxUpdate 属性

      时间:2023-09-24

      <tfoot id='J8pmF'></tfoot>

      <small id='J8pmF'></small><noframes id='J8pmF'>

        • <bdo id='J8pmF'></bdo><ul id='J8pmF'></ul>
        • <legend id='J8pmF'><style id='J8pmF'><dir id='J8pmF'><q id='J8pmF'></q></dir></style></legend>

              <tbody id='J8pmF'></tbody>

            <i id='J8pmF'><tr id='J8pmF'><dt id='J8pmF'><q id='J8pmF'><span id='J8pmF'><b id='J8pmF'><form id='J8pmF'><ins id='J8pmF'></ins><ul id='J8pmF'></ul><sub id='J8pmF'></sub></form><legend id='J8pmF'></legend><bdo id='J8pmF'><pre id='J8pmF'><center id='J8pmF'></center></pre></bdo></b><th id='J8pmF'></th></span></q></dt></tr></i><div id='J8pmF'><tfoot id='J8pmF'></tfoot><dl id='J8pmF'><fieldset id='J8pmF'></fieldset></dl></div>

              • 本文介绍了Yii cgridview ajaxUpdate 属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我在另一个 cgridview 中有一个 cgridview:外面的一个是:

                I have one cgridview inside another cgridview: the outer one is:

                $this->widget('application.modules.user.components.CsvGridView', array(
                    'dataProvider'=>$model->mySearch(),
                    'filter' => $model,
                    'id'=>'users-grid',
                ...
                

                内部是:

                $this->widget('zii.widgets.grid.CGridView', array(
                    'id'=>'vacr-grid',
                
                    'dataProvider'=>$model->searchu(),
                   // 'pager'=>false,
                   // 'enableSorting'=>false,
                    'summaryText'=>'',
                    'ajaxUpdate'=>'vacr-grid',
                
                    'columns'=>array(
                
                        'start',
                        'end',
                                array(
                                        'name' => 'vac_type',
                                        'value' =>
                                        'isset($data->vacType->name)?$data->vacType->name:$data->vac_type'
                                ),
                    ),
                ));
                

                问题是内部更新不正常(当然是用ajax更新).

                The problem is that the inner one does not update properly (of course update with ajax).

                例如,当我单击下一步"时,在内部 cgridview 中,请求的 URL 是:请求 URL:http://localhost/orm/vac/vac/adminu/user_id/1/Vac_page/2?ajax=用户网格
                请注意,用户网格是外部 cgridview 的 ID.然后在我点击下一步"后,内部和外部 cgridviews 都消失了.

                when I click on "next" for example, in the inner cgridview, the requested URL is: Request URL:http://localhost/orm/vac/vac/adminu/user_id/1/Vac_page/2?ajax=users-grid
                notice that users-grid is the id of the outer cgridview. and then after I click on "next" the inner and the outer cgridviews both disappears.

                我尝试使用 ajaxUpdate 属性 但它没有影响任何事情.谢谢.

                I try to use ajaxUpdate property but it does not affect anything. thank you.

                推荐答案

                这与我遇到的问题类似.排序和分页 url 由 dataProvider 设置,而搜索 url 由 ajaxUrl 设置.您必须将所有 3 项设置为脱离上下文使用 CGridView.

                This is a similar issue to one I was having. The sort and paging urls are set by the dataProvider whereas the search url is set by ajaxUrl. You have to set all 3 to use CGridView out of context.

                单独设置数据提供者:

                $dataProvider=new CActiveDataProvider('Modelname',array(
                    'criteria'=>$criteria,
                    'pagination'=>array(
                        'route'=>'something/search'
                    ),
                    'sort'=>array(
                        'route'=>'something/search'
                    )
                ));
                
                
                
                
                $this->widget('zii.widgets.grid.CGridView', array(
                    'id'=>'vacr-grid',    
                    'dataProvider'=>$dataProvider,
                    'summaryText'=>'',
                    'ajaxUpdate'=>'vacr-grid', // not necessary if same as id
                    'ajaxUrl'=>Yii::app()->createUrl( 'Something/search' ),  // this takes care of the search  
                    'columns'=>array(    
                        'start',
                        'end',
                                array(
                                        'name' => 'vac_type',
                                        'value' =>
                                        'isset($data->vacType->name)?$data->vacType->name:$data->vac_type'
                                ),
                    ),
                ));
                

                还有我类似的问题...

                Also my similar question...

                我该怎么做在 Yii 中使用 CGridView 的 ajaxUrl 参数?

                这篇关于Yii cgridview ajaxUpdate 属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:Php 继承、动态属性和新的 static() 构造函数 下一篇:Yii 对重载属性的间接修改

                相关文章

                    <i id='qwMkQ'><tr id='qwMkQ'><dt id='qwMkQ'><q id='qwMkQ'><span id='qwMkQ'><b id='qwMkQ'><form id='qwMkQ'><ins id='qwMkQ'></ins><ul id='qwMkQ'></ul><sub id='qwMkQ'></sub></form><legend id='qwMkQ'></legend><bdo id='qwMkQ'><pre id='qwMkQ'><center id='qwMkQ'></center></pre></bdo></b><th id='qwMkQ'></th></span></q></dt></tr></i><div id='qwMkQ'><tfoot id='qwMkQ'></tfoot><dl id='qwMkQ'><fieldset id='qwMkQ'></fieldset></dl></div>
                  1. <tfoot id='qwMkQ'></tfoot>
                    • <bdo id='qwMkQ'></bdo><ul id='qwMkQ'></ul>

                    <small id='qwMkQ'></small><noframes id='qwMkQ'>

                  2. <legend id='qwMkQ'><style id='qwMkQ'><dir id='qwMkQ'><q id='qwMkQ'></q></dir></style></legend>