L
L
Leopandro2016-01-23 00:26:19
JavaScript
Leopandro, 2016-01-23 00:26:19

How to update detailview widget by pjax?

<?php Pjax::begin(); ?>
        <?= DetailView::widget([
            'model' => $model,
            'attributes' => $columns
        ]);
        ?>
        <?php Pjax::end(); ?>


There is such a small table, there is also an action controller that returns $model when requested, how to make this received $model rendered by this widget?

I wrote his ajax code by hand
$('button[id]').click(function(){
    var x = $.ajax({
        'url' : 'http://catalogmaterial/web/index.php?r=basematerial%2Fmodel&id='+{$_GET['id']}+'&material_id='+$(this).attr('id')
    });
    console.log(x);
})


Is it possible to make an Ajax request using framework widgets?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question