Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- h2. My Observation on Bootstrap Modal data attributes
- =======
- I have added to data-* attributes for Modal window to pass data on to display.
- Data attributes are-
- #data-fyid
- #data-fyHead
- In the JavaScript code-
- `
- $('#fy_modal').on('show.bs.modal', function (event) {
- let button = $(event.relatedTarget) // Button that triggered the modal
- let fyid = button.data('fyid') // This give me the actual integer ID in modal
- // let fyhead = button.data('fyHead'); // This will return value as undefined
- let fyhead = button.data('fyhead'); // This will return correct value
- ....
- });
- `
- So to get the value for **data-fyHead** attribute, I have to chage the case of the variable to **data-fyhead**, this solve my problem.
- I learn that camelcase is not supported in Bootstrap modal to pass data via attributes.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement