mdbootstrap / mdb-ui-kit

Bootstrap 5 & Material Design UI KIT
https://mdbootstrap.com/docs/standard/
Other
24.2k stars 3.53k forks source link

Checkbox does not appear #389

Closed Obiwarn closed 9 years ago

Obiwarn commented 9 years ago

I use Meteor. Everything works great including ripples, etc.

But checkboxes do not appear, just the text when I use:

Notify me about updates to apps or games that I've downloaded

FezVrasta commented 9 years ago

can you provide a demo to see the problem? I really don't know meteor so much so without see it I can't understand.

Obiwarn commented 9 years ago

hm....it seems that some of the JS is not working.

I also cannot get the dropdown.js to work.

Any ideas?

RomainLanz commented 9 years ago

@obiwarn Did you write $.material.init(); or $.material.checkbox(); on your body?

255kb commented 9 years ago

@obiwarn i had the same problem, this is due to the fact that material elements are initialized before the template is rendered by Meteor. As @RomainLanz said you must use $.material.checkbox(); or $.material.init();. Put this after the template has been rendered, by using Meteor rendered function; like this:

Template.myTemplate.rendered = function(){
    $.material.init();
};

I think that this issue can be closed as it is not directly related to Bootstrap material design.

Obiwarn commented 9 years ago

Thank you!

Checkbox & radio work great now.

However, dropdowns still not :-(

FezVrasta commented 9 years ago

dropdowns are provided by dropdown.js (https://github.com/FezVrasta/dropdown.js)

Obiwarn commented 9 years ago

I know. But this did not work for me in Meteor:

$(".select").dropdown({ "autoinit" : ".select" });

FezVrasta commented 9 years ago

sorry without an example (codepen or similar) I can't say why it's not working.

MrDanMacDonald commented 9 years ago

Great work! I am having the same issues with the checkbox (and all of the form animations) in my rails app - the checkbox doesn't appear, nor do any of the animations.

Any suggestions?

FezVrasta commented 9 years ago

Did you init them?

MrDanMacDonald commented 9 years ago

@FezVrasta Hi Fez, I haven't tried that yet but definitely will.

phtn commented 9 years ago

Template.homepage.rendered = () => { $.material.init() }

material has to initialize on render