Giter Site home page Giter Site logo

Comments (11)

ihorchepurnyi avatar ihorchepurnyi commented on June 22, 2024

Can you please describe more detail your issue?

from yii2-editable.

milansuthar811 avatar milansuthar811 commented on June 22, 2024

[ 'header' => DidmasterModule::t('didmaster', 'Service'), 'class' => EditableColumn::className(), 'attribute' => 'serviceName.serv_name', 'url' => '/didmaster/didtenant/get-services', 'type' => 'select', 'editableOptions' => function ($model) { return [ 'source' => ArrayHelper::map(ServiceMaster::getServicePackages(), 'serv_id', 'serv_name'), 'value' => $model->sv_id, ]; }, ],

Above is my code.
When I called 'get-services()' method and get complete operation with success, I need to reload my Grid.

from yii2-editable.

ihorchepurnyi avatar ihorchepurnyi commented on June 22, 2024

Ok, I check it later

from yii2-editable.

milansuthar811 avatar milansuthar811 commented on June 22, 2024

@igor-chepurnoi are you understand my problem?

from yii2-editable.

ihorchepurnyi avatar ihorchepurnyi commented on June 22, 2024

Yes, As I understand, you need to reload gridview after value has been saved, right?

After editable ajax request has been completed.

from yii2-editable.

milansuthar811 avatar milansuthar811 commented on June 22, 2024

@igor-chepurnoi Yes, I need to reload gridview after value has been saved. Please help me in it.
Thanking you.

from yii2-editable.

ihorchepurnyi avatar ihorchepurnyi commented on June 22, 2024

Ok, I'll try to help.

from yii2-editable.

ihorchepurnyi avatar ihorchepurnyi commented on June 22, 2024

I have updated this package, please update the package to dev-master version, and use the following code for update your gridview

You need to define clientOptions array with success callback

Grid view example

<?php Pjax::begin(['timeout' => 10000, 'options' => ['id' => 'grid-pjax-container']]); ?>
    <?php echo GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            [
                'class' => EditableColumn::class,
                'attribute' => 'username',
                'url' => ['edit-user'],
                'clientOptions' => [
                    'success' => (new \yii\web\JsExpression('function() {
                        $.pjax.reload({container: "#grid-pjax-container"}); // this code for update grid
                    }'))
                ],
            ],
            [
                'header' => Yii::t('app', 'Action'),
                'class' => 'yii\grid\ActionColumn',
                'template' => '{update} {delete}',
            ],
        ],
    ]);
    ?>
    <?php Pjax::end(); ?>

from yii2-editable.

milansuthar811 avatar milansuthar811 commented on June 22, 2024

thanks @igor-chepurnoi,
i tried it but its giving following exception
Setting unknown property: yii2mod\editable\EditableColumn::clientOptions

from yii2-editable.

ihorchepurnyi avatar ihorchepurnyi commented on June 22, 2024

You need to update yii2mod/yii2-editable package via command composer update, set version to dev-master

from yii2-editable.

milansuthar811 avatar milansuthar811 commented on June 22, 2024

Thanks @igor-chepurnoi .

from yii2-editable.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.