Bootstrap
Docs HomeProduct SiteSupport
  • Introduction
  • Buttons
    • Configuration
    • Data Binding
  • Checkboxes
    • Configuration
    • Data Binding
    • Events
  • Input
    • Configuration
    • Data Binding
    • Events
    • Methods
  • Modals
    • Message
    • Error
  • Search List
    • Configuration
    • Data Binding
    • Methods
  • Select
    • Configuration
    • Data Binding
    • Events
  • Table
    • Configuration
    • Data Binding
    • Events
  • Web Components
Powered by GitBook
On this page
  • Properties
  • Datamap
  1. Checkboxes

Data Binding

PreviousConfigurationNextEvents

Last updated 2 years ago

The for the Bootstrap checkboxes component is listed below. The component expects these field names in its data configuration.

Properties

Name

Description

id

The field in the data to be used as the unique id for checkboxes

label

The field in the data to be used as the display label for checkboxes

checked

Optional. The field in the data to determine whether an option should be checked by default.

const users = [
    { id: "bsimmons", label: "Ben Simmons", checked: false },
    { id: "jembiid", label: "Joel Embiid", checked: true }
]

const checkboxes = new wire.bsCheckboxes().render("#checkboxes", {
    data: users
});

Datamap

Use the datamap configuration property to bind a data structure to the component that does not have the same field names.

const users = [
    { user: "bsimmons", name: "Ben Simmons" },
    { user: "jembiid", name: "Joel Embiid" },
]

const checkboxes = new wire.bsCheckboxes().render("#checkboxes", {
    data: users,
    datamap: { id: "user", label: "name" }
});
data map