Вход

Просмотр полной версии : Почему не работают условия в bind?


khusamov
10.06.2015, 15:23
Почему не работают условия в bind?

bind: {
disabled: "{!form.isDirty || !form.isValid}"
}

Операнд NOT можно, а ИЛИ нельзя?

novikov
16.06.2015, 12:44
Нужно использовать формулы (http://docs.sencha.com/extjs/5.1/5.1.1-apidocs/#!/api/Ext.app.bind.Formula). В писании сказано (http://docs.sencha.com/extjs/5.1/application_architecture/view_models_data_binding.html#Binding_Boolean_Conf igs):

Many configs you will want to bind are boolean values, such as visible (or hidden), disabled, checked, and pressed. Bind templates support boolean negation “inline” in the template. Other forms of algebra are relegated to formulas (see below), but boolean inversion is common enough there is special provision for it.

khusamov
17.06.2015, 01:06
Спасибо! Понял.