Created
August 9, 2022 15:08
-
-
Save ljmclaney/cc94d1648c33819ab3866840f57a4117 to your computer and use it in GitHub Desktop.
Sortable exmaple
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let $this = this; | |
const fieldsEl = document.getElementById('fields'); | |
Sortable.create(fieldsEl, { | |
onChange: function (evt) { | |
let list = this.toArray(); | |
list.forEach(function (uuid, index) { | |
$this.fields[field].sort_order = index | |
}) | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment