D
D
DEVBDA2019-12-19 23:25:30
UIkit
DEVBDA, 2019-12-19 23:25:30

How to fire the moved event after sorting using UIkit?

How to fire the moved event after sorting using UIkit?
in the manual it is written that it is necessary to use initialization:
UIkit.sortable(element, options);
for example there is:

<ul id="elms" class="uk-grid-small uk-child-width-1-2 [email protected] uk-text-center" uk-sortable="handle: .uk-card" uk-grid>
    <li>
        <div class="uk-card uk-card-default uk-card-body">Item 1</div>
    </li>
    <li>
        <div class="uk-card uk-card-default uk-card-body">Item 2</div>
    </li>
</ul>

after
UIkit.sortable('#elms', {
   moved: function(){
         alert(1);
   }
});

well, nothing works, with F5 it just fires alert once and that's it, tell me what I'm doing wrong?

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