how to disabled button view?

hello!
how to disabled button view?thanks!
code:{ view:“button”, label: ‘Clear’, click:“clear_form” }

Hi,

there is not “disable” method for a button view. Try one of the following method:

  1. hide button:

{ view:“button”, label: ‘Clear’, click:“clear_form”, hidden: true }

  1. add check in clear_form:

disabledButton = true;

function clear_form(){
if(!disabledButton){
// your code
}
}