Support » Plugin: CMB2 » CMB2 custom conditional implementation

  • TheNewGuy_14


    Hey so I am trying a custom implementation of cmb2 conditional stuff because the plugins out there don’t work for every field and I have a custom theme that I use with cmb2 tied into it.

    But basically I just wrap fields and group rows with a div that has a class of field-wrapper and a class from the select box that has different layout names.

    So you choose a layout and the jQuery finds the field-wrappers with that class and shows them and hides the rest.

    Works great for the first group row but when you add a new row the console will log the select box change but won’t show the group rows or fields when the select box is changed. And if you change the select box then update the page the correct row or fields show and then you can change the select box again and it changes the rows and fields again. So its almost like you have to lock in the new group row to the database for the jQuery to recognize it. Is there away to trigger an ajax save so that the new rows get recognized?

    Disclaimer: I have taught myself a lot of programming stuff and maybe I just am missing something small like maybe the DOM doesn’t register elements that are display none or something else but I am just looking for a little guidance on how i can get this to work so that when I had my theme over to other developers it will work the right way. Any help would be awesome and I can send over the jQuery file and page layout cmb2 file if you are will to look into it. Any help would be awesome

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘CMB2 custom conditional implementation’ is closed to new replies.