【问题标题】:Yii Tbgridview Not Working In Ie8 - Bootstrap TbGridView disappears in sorting, paging and filtering -IE8Yii Tbgridview 在 Ie8 中不起作用 - Bootstrap TbGridView 在排序、分页和过滤中消失 - IE8
【发布时间】:2012-12-20 07:28:27
【问题描述】:

我已将 yii bootstrap 扩展集成到我的网站中。我有一个显示网格视图的页面。虽然它是引导程序,但我使用了 TbGridView。基本的 GridView 功能,如排序、分页、过滤,在除 IE8 之外的所有浏览器中一切正常。每当我尝试在 Grid 中执行排序、分页、过滤时,Grid 就会消失。它只发生在 IE8 中。我已经通过调试检查了 jquery-yiigridview.js。特别是,

[代码]

更新:功能(选项){

[/代码]

但没有发现什么特别的。唯一让我明白的是,在 IE8 中,响应没有附加到网格(#id)。缺少与 IE8 中的 ajax 渲染相关的内容。

奇怪的是,我有另一个页面,我正在使用 renderPartial 方法使用弹出窗口。还有一个 TbGridView。但这在 IE8 中运行良好。

更多信息:

控制器: [代码]

        public function actionRate()
        {
        $requestModel = new Rate('search');             
        $requestModel->unsetAttributes();  // clear any default values
        if(isset($_GET['Rate']))
        $requestModel->attributes=$_GET['Rate'];                              
       $this->render('requestList', array('model'=>$requestModel)); 
        }

[/代码]

查看:

[代码]

$this->widget('bootstrap.widgets.TbGridView', array(
'id'=>'request-grid-list',
'filter'=>$model,
'type'=>'striped bordered condensed',
'dataProvider'=>$model->search(),   
'columns'=>array(               
        array(
                'name' => 'ratename',
                'type'=>'raw',
                'value' => '$data->ratename',
        )
        ),)); 

[/代码]

【问题讨论】:

    标签: gridview twitter-bootstrap internet-explorer-8 yii


    【解决方案1】:

    经过这么多调试,我在IE8中找到了问题的原因。

    我的第一个想法是 jquery-yiigridview.js。我发现,jquery-yiigridview.js 中用于 yii 网格的更新方法工作正常。

    $.each(settings.ajaxUpdate, function (i, el) {
        var updateId = '#' + el;
        $(updateId).replaceWith($(updateId, $data));
    });
    

    然后网格突然消失了。是的,问题出在“响应数据”上。 Firefox 和 Chrome 完美呈现。但是在 IE8 中它会导致错误。所以我检查了响应数据。我的 main.php 布局文件中有“bootstrap.widgets.TbNavbar”。当我删除它时,它起作用了。但这不是解决办法。我检查了为什么它在 IE8 中中断。

    $this->widget('bootstrap.widgets.TbNavbar', array(
        'type'=>'inverse', // null or 'inverse'
        'brand'=>$brandName,
        'brandUrl'=>'#',
        'collapse'=>true, // requires bootstrap-responsive.css
        'items'=>array(
            array(
    

    'collapse'=>true 是问题所在。所以我删除了那条线。现在它在 IE8 中完美运行。

    但这还没有结束..接下来是..学习,,:) :)

    http://twitter.github.com/bootstrap/scaffolding.html#responsive

    注意:这是一个快速修复。请分享你的想法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多