首页 \ 问答 \ 未定义的变量:karik gridview中的gridColumns:yii2(Undefined variable: gridColumns in karik gridview:yii2)

未定义的变量:karik gridview中的gridColumns:yii2(Undefined variable: gridColumns in karik gridview:yii2)

我正在尝试使用kartik gridview并得到以下错误。 -

Undefined variable: gridColumns

我已经检查了 - Yii2:Kartik Gridview页脚的总和 。 但是在我的代码中没有找到问题。

index.php代码 -

<?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => $gridColumns,
        'showPageSummary' => true,
        'columns' => [
            ['class' => 'kartik\grid\SerialColumn'],
            [
                'attribute'=>'s_period',
                'filter'=>ArrayHelper::map(Salary::find()->asArray()->all(), 's_period', 's_period'),
            ],
            's_empid',
            's_empname',
            [
                'attribute'=>'s_epf',
                'pageSummary'=>true
            ],


            //['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>

I'm trying to use kartik gridview and got the following error. -

Undefined variable: gridColumns

I've checked - Yii2: Kartik Gridview sum of a column in footer. But didn't find the issue in my code.

Code of index.php -

<?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => $gridColumns,
        'showPageSummary' => true,
        'columns' => [
            ['class' => 'kartik\grid\SerialColumn'],
            [
                'attribute'=>'s_period',
                'filter'=>ArrayHelper::map(Salary::find()->asArray()->all(), 's_period', 's_period'),
            ],
            's_empid',
            's_empname',
            [
                'attribute'=>'s_epf',
                'pageSummary'=>true
            ],


            //['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>

原文:https://stackoverflow.com/questions/38289576
更新时间:2022-06-25 19:06

最满意答案

更换:

Intent I = new Intent(this, BusInfo.class);

有:

Intent I = new Intent(MainActivity.this, BusInfo.class);

Replace:

Intent I = new Intent(this, BusInfo.class);

with:

Intent I = new Intent(MainActivity.this, BusInfo.class);

相关问答

更多
  • 在pendingIntent你不应该使用标志? PendingIntent pIntent2 = PendingIntent.getActivity(ctx, 0, intent2, Intent.FLAG_ACTIVITY_NEW_TASK); 或这个 PendingIntent.FLAG_UPDATE_CURRENT I sorted the problem by giving each PendingIntent a new ID, I believe the problem ws the ...
  • OnInfoWindowClickListener用于地图 ,而不是标记 。 那么,您当前的代码是: 创建OnInfoWindowClickListener 创建另一个OnInfoWindowClickListener ,丢弃前一个 等等 调用setOnInfoWindowClickListener() 一次 。 在onInfoWindowClick() ,您将传递一个表示用户单击的Marker 。 使用该Marker ,确定要放入Intent的额外值。 例如,IIRC, Marker有一个getId()方 ...
  • 我通过使用if else语句解决了这个问题。 我在开始时添加了标记,就在onCreate方法之前。 例如,protected static Marker Pin = null; protected static Marker Casino = null; if(Casino.isInfoWindowShown()){ Intent intent = new Intent(MainActivity.this, TheRock.class); ...
  • 我在这里读到他们只是为了表现而存在。 想象一下,你想要删除一个表,但是你必须检查每一行是否锁定 - 这将是非常耗时的,你必须锁定你检查的每一行。 这是博客文章的引用: 从技术角度来看,SQL Server并不真正需要Intent Locks。 它们与性能优化有关。 让我们更详细地看一下。 使用Intent Lock SQL Server只是在Lock Hierarchy中的更高级别指示您已在其他位置获取了Lock。 Intent Shared Lock告诉SQL Server其他地方有共享锁。 Intent ...
  • 更换: Intent I = new Intent(this, BusInfo.class); 有: Intent I = new Intent(MainActivity.this, BusInfo.class); Replace: Intent I = new Intent(this, BusInfo.class); with: Intent I = new Intent(MainActivity.this, BusInfo.class);
  • 当您使用隐式意图启动服务时不像Activity,不涉及用户界面。 当多个服务可以处理一个意图时,Android会随机选择一个; 用户不会被提示选择服务。 如果恶意服务绑定到调用应用程序,则攻击者可以返回任意恶意数据,或者仅仅返回一个成功的结果而不采取请求的操作。 恶意服务可以窃取数据并说谎完成请求的操作。 When you start a service with implicit intent unlike Activity, no user interface is involved. When mul ...
  • PhoneStateListener有助于在电话呼叫结束时返回原始活动(实际上,它只是重新启动活动)。 MainActivity .java import android.app.Activity; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.telephony.PhoneStateListener ...
  • 我解决了这个问题。 如果任何人面临这个问题,请参考这个。 我做的是创建一个处理程序,在一段延迟后运行代码片段,并在调用处理程序后从onInfoWindowClick方法返回 。 mapCompanyList .setOnInfoWindowClickListener(new OnInfoWindowClickListener() { @Override public void onInfoWin ...
  • 不要将GoogleMap.setOnInfoWindowClickListener放入循环中。 它会覆盖您之前设置的任何侦听器。 而是在您检索对GoogleMap引用之后立即设置它并区分onInfoWindowClick内的onInfoWindowClick 。 Don't put GoogleMap.setOnInfoWindowClickListener in a loop. It overrides any listener you set previously. Instead set it onc ...
  • 你忘了开始像Activity一样 Youractivity.this.startActivity(in); 并尝试另一种方式 googleMap.setOnInfoWindowClickListener(new OnInfoWindowClickListener() { public void onInfoWindowClick(Marker marker) { Message mesg = new Message(); Bundle b = new Bundl ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)