Javascript TypeError:undefined不是对象(正在评估设置。tableClass';)
我以前在复选框中使用过yiiGridView,它工作得很好,但当我尝试在renderPartial页面上执行此操作时,它会不断出现此错误。 这是我的看法Javascript TypeError:undefined不是对象(正在评估设置。tableClass';),javascript,php,jquery,yii,Javascript,Php,Jquery,Yii,我以前在复选框中使用过yiiGridView,它工作得很好,但当我尝试在renderPartial页面上执行此操作时,它会不断出现此错误。 这是我的看法 <div class="modal-dialog modal-dialog-centered" style="width: 80em"> <div class="modal-content"> <div class="modal-header"> <button type="bu
<div class="modal-dialog modal-dialog-centered" style="width: 80em">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="color: white">×</button>
<h4 class="modal-title"><?php echo Yii::t('webposModule.strings','cusRelation.emailTemplate')?></h4>
</div>
<div class="modal-body clearfix" style="width: 80em; overflow-y: auto; max-height: 20%">
<div class="clearfix">
<div class="form-group">
<i><?php echo Yii::t('webposModule.strings','cusRelation.birthdayPackage.chooseList'); ?></i>
<?php
$this->widget('zii.widgets.grid.CGridView',array(
'id' => 'oc-list-email-template',
'dataProvider'=> $dataProvider,
'summaryText' =>'',
'htmlOptions' => array('style' => 'overflow-y: auto; max-height: 40%'),
'emptyText' => Yii::t ('webposModule.strings', 'cusRelation.birthdayPackage.promoList.empty'),
'columns' => array(
array('name'=> 'emailid',
'value'=>'$data["id"]',
'htmlOptions' => array('style' => 'display:none;'),
'headerHtmlOptions'=>array('style' => 'display:none;'),
'filterHtmlOptions'=>array('style' => 'display:none;'),
),
array(
'header' => '',
'id' => 'chkbox',
'name' => 'checkBox',
'selectableRows' => 2,
'class' => 'CCheckBoxColumn',
),
array(
'header'=> Yii::t('webposModule.strings','cusRelation.templateName'),
'name'=> 'templateName',
'value'=>'$data["template_name"]',
'htmlOptions' => array('style'=> 'cursor: pointer'),
),
array(
'header'=> Yii::t('webposModule.strings','cusRelation.subject'),
'name'=> 'subject',
'value'=>'$data["subject"]',
'htmlOptions' => array('style'=> 'cursor: pointer'),
),
),
));
?>
</div>
</div>
<div class="clearfix">
<div class="col-md-3">
<?php echo CHtml::button(Yii::t ('webposModule.strings', 'cusRelation.apply'), array('id'=>'apply-email-template','class'=>'btn btn-default btn-top-rv oc-apply-email-template btn-block','data-dismiss'=>'modal')); ?>
</div>
</div>
</div>
</div>
我注意到的第一件事是,
Octopus::catchRequest('memid')
是否返回正确的d字符串?好的,我很确定您不应该自己调用$.fn.yiiGridView.getChecked
,而不是那样。而是类似于$(gridID).yiiGridView('getChecked',columnID)
$(document).on('click', '.oc-apply-email-template', function (event) {
var memid = <?php echo Octopus::catchRequest('memid')?>;
var selectedCheckbox = $.fn.yiiGridView.getChecked('oc-list-email-template', 'chkbox');
console.log(selectedCheckbox);
})
this.find('.' + settings.tableClass).children('tbody').children('tr').children('td').children('input[name="' + column_id + '"]').each(function (i) {