作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我只想存储票证项目的 id,当我检查控制台时,我只是得到一个空数组。知道为什么吗?
CCheckBoxColumn 上的 Yii 文档指出:
You may also call the JavaScript function $(gridID).yiiGridView('getChecked', columnID) to retrieve the key values of the checked rows.
所以我有:
$this->widget('bootstrap.widgets.BsGridView', array(
'id' => 'audits-lines-grid',
'dataProvider' => $auditlines->search($model->audit_id),
'filter' => $auditlines,
'selectableRows' => 2,
'columns' => array(
array(
'class' => 'CCheckBoxColumn', 'selectableRows' => 2,
'id' => 'selected-checkboxes',
'value' => 'CHtml::tag("span", array("class" => "$data->statusLabel"), "$data->status", "</span>")',
'name' => 'CHtml::tag("span", array("class" => "$data->statusLabel"), "$data->status", "</span>")',
),
(some more code here..)
我正在尝试使用
获取检查值<script>
$(document).on('click','#block-change-location',function(){
var items = $('#audits-lines-grid').yiiGridView('getChecked', '#selected-checkboxes')
console.log(items);
});
</script>
最佳答案
使用
$.fn.yiiGridView.getChecked("your-grid-id", "selected-checkboxes");
关于javascript - $(gridID).yiiGridView ('getChecked' , columnID) 返回空数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35294124/
如果在我的 wpf 应用程序中有多个网格和一个可拖动的用户控件。任何人都可以建议每次将控件拖动到不同网格上时可以返回不同网格 ID 的代码。 最佳答案 您可以使用 Mouse.DirectlyOver
我只想存储票证项目的 id,当我检查控制台时,我只是得到一个空数组。知道为什么吗? CCheckBoxColumn 上的 Yii 文档指出: You may also call the JavaScr
我是一名优秀的程序员,十分优秀!