dart - How do I programatically select and disable a PaperButton? -


i'm trying migrate bootstrap polymer/paper , i've got lot of situations have enable/disable buttons accessed buttonelements , .disabled=true/false.

so example i've got paper button i'm trying access , enable/disable via queryselector such:

paperbutton nextweekbutton = queryselector("#nextweekbutton"); nextweekbutton.disabled=!_status; 

but getting error: type 'htmlelement' not subtype of type 'paperbutton' of 'nextweekbutton'.

i same variety of message if try inputelement or buttonelement. if try htmlelement of course "setter 'disabled' not defined..."

i going start playing around attribute setting shouldn't there way that's buttonelement? want make sure not missing anything.

update: doing this

void disablebutton(element _e, bool _status) {   if(!_status) {     _e.setattribute("disabled","true");   } else {     _e.attributes.remove("disabled");   } } 

i'm pretty sure problem code executed before polymer initialized. see https://stackoverflow.com/a/20982658/217408 how initialize polymer when have custom main method.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -