1

我正在使用 kartik\grid\GridView 和 kartik\grid\ExpandRowColumn 来显示摘要信息。在 expandRowColumn 上,我有另一个网格视图来列出详细信息。这部分工作正常。

在 expandRowColumn gridview 下,我使用模式来查看列详细信息的数据。在第一个 expandRowColumn 上单击模式工作正常,但在其他 expandRowColumn 行上出现错误。

没有错误消息,但模态不显示 error_image

expandRowColumn 上的 Gridview

$gridColumns = [
    ['class' => 'yii\grid\SerialColumn'],
    [
    'label'=>Yii::t('app','Borderaux No'),
    'format'=>'raw',
    'value'=>function($data) {
        return $data['bordereaux_number'];
    },
    ],
    [
    'label'=>Yii::t('app','Details'),
            'format'=>'raw',
            'value'=>function($data) {

            if ( $data['status'] != 0 ) {

            //modal - list by borderaux no
                $text = '<i class="fa fa-comments-o fa-fw"></i> View';
                $url = '/inpatient/claim/summaryborderauxdetails?status=' . $data['status'] .
                        "&month=" . $data['month'] . "&year=" . $data['year'] .
                        "&search_type=" . $data['search_type'] . "&reimbursement=" . $data['reimbursement'] .
                        "&client_id=" . $data['client_id'] .'&borderaux_number=' . $data['bordereaux_number'] ;
                $options = [
                            'class' => 'summary-borderaux-link',
                            'data-target' => '#summary-borderaux-modal',
                            'data-toggle'=>'modal',
                            'data-id' => $data['bordereaux_number'],
                            'data-pjax' => '0',
                            ];
                return Html::a( $text, $url , $options  );

            }

            },
            'headerOptions' => ['style'=>'text-align:left;'],     'contentOptions'=>['style'=>'text-align: right;'],
    ],];


Modal::begin(['id' =>'summary-borderaux','size'=>'modal-lg','header' => '<h4 class="modal-title">' . Yii::t('app','Details') .'</h4>']);Modal::end();

Pjax::begin(['id'=>'summary_details','enablePushState'=>FALSE]);
echo GridView::widget(['dataProvider' => $dataProvider,
'id'=>'summary_details_by_borderaux',
'columns' => $gridColumns,]);
Pjax::end(); 


$this->registerJs("$(function() {
$('.summary-borderaux-link').click(function(e) {
e.preventDefault();
 $('#summary-borderaux').modal('show').find('.modal-body')
 .load($(this).attr('href'));
return false;
});
});");
4

0 回答 0