• <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 属性

      Yii cgridview ajaxUpdate property(Yii cgridview ajaxUpdate 属性)

      <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 属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                    <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>
                      <tbody id='qwMkQ'></tbody>
                  1. <tfoot id='qwMkQ'></tfoot>
                    • <bdo id='qwMkQ'></bdo><ul id='qwMkQ'></ul>

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

                        • <legend id='qwMkQ'><style id='qwMkQ'><dir id='qwMkQ'><q id='qwMkQ'></q></dir></style></legend>