G
G
gachkydxvbgd2018-02-19 22:50:33
Yii
gachkydxvbgd, 2018-02-19 22:50:33

How to convert nestable yii2?

How to remake it

<!--<div class="dd" id="nestable">-->
<!--    <ol class="dd-list">-->
<!--        <li class="dd-item" data-id="1">-->
<!--            <div class="dd-handle">Item 1</div>-->
<!--        </li>-->
<!--        <li class="dd-item" data-id="11">-->
<!--            <div class="dd-handle">Item 11</div>-->
<!--        </li>-->
<!--        <li class="dd-item" data-id="12">-->
<!--            <div class="dd-handle">Item 12</div>-->
<!--        </li>-->
<!--    </ol>-->
<!--</div>-->

Under it
<?= GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'tableOptions' => ['id' => 'nestable'],
    'columns' => [
        ['class' => 'yii\grid\SerialColumn'],
        
        'name',
        'created_at:datetime',

        ['class' => 'yii\grid\ActionColumn'],
    ],
]); ?>

As a result, we need a table, with the ability to move elements

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2018-02-19
@gachkydxvbgd

Good evening.
For this better use Sortable

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question