Yii2 kartik-v gridview:TypeError:jQuery(…)。可编辑不是函数

Yii2 kartik-v gridview:TypeError:jQuery(…)。可编辑不是函数,jquery,gridview,yii2,Jquery,Gridview,Yii2,当第一次将第一个新数据插入gridview时(此时gridview中没有来自数据库的数据),所有可编辑列都显示为出现故障的按钮,而不是工作链接。刷新页面后,Gridview中的可编辑列按预期显示为链接并正常工作 为什么只有第一次出现这个问题 这是在将第一个新数据插入Gridview后显示的错误 类型错误:jQuery(…)。可编辑不是一个函数 这是我的专栏: [ 'class' => 'kartik\grid\EditableCol

当第一次将第一个新数据插入gridview时(此时gridview中没有来自数据库的数据),所有可编辑列都显示为出现故障的按钮,而不是工作链接。刷新页面后,Gridview中的可编辑列按预期显示为链接并正常工作

为什么只有第一次出现这个问题

这是在将第一个新数据插入Gridview后显示的错误

类型错误:jQuery(…)。可编辑不是一个函数

这是我的专栏:

             [
                'class' => 'kartik\grid\EditableColumn',
                'attribute' => 'short_desc',
                'refreshGrid' => true,
                'editableOptions' => function ($model, $key, $index) {
                    return [
                        'header'=>'short_desc',
                        'size'=>'md',

                    ];
                }
            ]

谢谢。

即使在pjax重新加载之后,当只有一个数据(第一个数据)时,我也一直在使用我的代码刷新页面

在addNewData()的jquery函数中,我在成功添加新数据后重新加载pjax后添加了以下代码:

<?php                       
     $models = $dataProvider->getModels(); // get dataProvider to check if there is any data

     // refresh whole page for the first newly added data when there is only one data as in Editable Column not initiated when there is no data
     if( count($models) < 1 || $models == null || !isset($models) )                         
     {
 ?>
         window.location.reload();
 <?php                              
     }                      
 ?>

window.location.reload();
这是我现在的工作