Появилась такая проблема. на странице GridView
Код: Выделить всё
<?php echo GridView::widget([
'dataProvider' => $dataProvider,
'emptyText' => '...',
'showOnEmpty' => false,
'tableOptions' => [
'class' => 'table'
],
'layout' => '{items}<div class="datatable-footer">{summary}{pager}</div>',
'options' => [
'id' => 'grid',
'class' => 'table-responsive',
],
...
Код: Выделить всё
(function ( $ ) {
$.fn.extend({
reportPrint: function (options) {
if (typeof $(this).yiiGridView === 'undefined') return false;
var _default = {
elem:'.checkbox-column',
btn:'.report-print-btn',
isActive: function (elem) {
return $(elem).yiiGridView('getSelectedRows').length > 0;
},
disable:function (elem) {
this.isActive(elem) ? $(this.btn).removeClass('disabled') : $(this.btn).addClass('disabled');
}
};
var params = $.extend(_default,options);
$(document).on('change',params.elem,function () {
params.disable();
});
params.disable();
return this;
}});
}(jQuery));
Код: Выделить всё
Uncaught TypeError: Cannot read property 'selectionColumn' of undefined
at jQuery.fn.init.getSelectedRows (yii.gridView.js:203)
at jQuery.fn.init.$.fn.yiiGridView (yii.gridView.js:15)
at Object.isActive (gridView.report.print.js:9)
at Object.disable (gridView.report.print.js:12)
at jQuery.fn.init.reportPrint (gridView.report.print.js:19)
at gridView.report.print.js:24
getSelectedRows @ yii.gridView.js:203
$.fn.yiiGridView @ yii.gridView.js:15
isActive @ gridView.report.print.js:9
disable @ gridView.report.print.js:12
reportPrint @ gridView.report.print.js:19
(anonymous) @ gridView.report.print.js:24