【问题标题】:Yii2: GridView Sorting removed from column headerYii2:从列标题中删除 GridView 排序
【发布时间】:2018-03-21 00:29:00
【问题描述】:
[
    'header' => Yii::t('app', 'Price') . ' usd.',
    'contentOptions' => [ 'class' => 'text-right'],
    'attribute' => 'price',
    'format'=>['decimal',2],
    'headerOptions' => ['data-type'=>'number'],
]

我需要查看格式化资金,但它会从标题中删除列的排序链接。

我使用footable

【问题讨论】:

  • 请添加更多详细信息,如果它是关于从列名中删除的链接进行排序,那么排序不起作用的意思,那么下面的答案将为您工作

标签: gridview datagridview yii yii2 footable


【解决方案1】:

你应该使用label 选项而不是header

[
    'label' => Yii::t('app', 'Price') . ' usd.',
    'contentOptions' => [ 'class' => 'text-right'],
    'attribute' => 'price',
    'format'=>['decimal',2],
    'headerOptions' => ['data-type'=>'number'],
]

【讨论】:

  • 当你点击列名Price usd@NikitaShahov时它没有排序我刚刚测试过它并且它有效
  • 对不起,我忘了说。我为gridview使用footable初始化
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-01-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多