Methods
const users = [
{ user: "bsimmons", name: "Ben Simmons", isGood: false },
{ user: "jembiid", name: "Joel Embiid" , isGood: true }
const select2 = new wire.select2().render("#select", {
data: users,
datamap: { id: "user", text: "name" }
});
...
const user = select2.getSelectedItem();
// user = { id: "jembiid", text: "Joel Embiid" }Last updated
Was this helpful?