L
L
Leopandro2016-03-18 20:32:08
Yii
Leopandro, 2016-03-18 20:32:08

Pjax request on input event is not possible?

I have a form, when submitting it, a pjax request is made to the server, which returns the content to me, but how can I make the request be made on the input event?
view:

<div class="client-index">
    <div class="col-xs-2">
        <h3 style="margin-top:0px"><?= Yii::t('app', 'Search title') ?></h3>
        <div class="row-fluid">
            <?= $this->render('_search', [
                'model' => $searchModel
            ])?>
        </div>
    </div>
    <div class="col-xs-10" id="clients_list">
        <h3 style="margin-top:0px"><?= Html::encode($this->title) ?></h3>
        <div class="row-fluid">
            <p>
                <?= Html::a(Yii::t('app', 'Create client'), ['create'], ['class' => 'btn btn-success', 'id' => 'create_client']) ?>
            </p>
        </div>
        <?
//        \yii\widgets\Pjax::begin(['id' => 'list_client']);
            echo ListView::widget([
            'dataProvider' => $dataProvider,
            'options' => [
                'tag' => 'div',
                'class' => 'list-wrapper',
                'id' => 'list-wrapper',
                ],
            'layout' => "{summary}\n{pager}\n{items}",
            'itemView' => function ($model, $key, $index, $widget) {
                return Html::a($model->name, ['/client/view', 'id' => $model->id], ['class'=>'btn btn-default']);
            }
            ]);
//        \yii\widgets\Pjax::end();
        ?>
    </div>

</div>

Code generated by the framework:
jQuery(document).pjax("#pjax_inner a", "#pjax_inner", {"push":true,"replace":false,"timeout":"20000","scrollTo":false});
jQuery(document).on('submit', "#pjax_inner form[data-pjax]", function (event) {jQuery.pjax.submit(event, '#pjax_inner', {"push":true,"replace":false,"timeout":"20000","scrollTo":false});});

I did not find a solution on the Internet in any site, I read the documentation. In my opinion, this task is impossible.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korovin, 2016-03-18
@Leopandro

What event? You probably mean onkeyup .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question