Compare commits
No commits in common. "8b551128e0dfd405ad786a8fcb85840e04a2a052" and "7a97e9419242125e6575eef2d4111552eb2d4fab" have entirely different histories.
8b551128e0
...
7a97e94192
@ -23,7 +23,7 @@ bricks.FieldGroup = class {
|
|||||||
parent.add_widget(dc);
|
parent.add_widget(dc);
|
||||||
dc = new bricks.DynamicColumn({mobile_cols:2});
|
dc = new bricks.DynamicColumn({mobile_cols:2});
|
||||||
dc.set_id(fields[i].name+'_box');
|
dc.set_id(fields[i].name+'_box');
|
||||||
if (fields[i].nonuse))
|
if (fields[i].disabled))
|
||||||
dc.disabled(true);
|
dc.disabled(true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -47,7 +47,7 @@ bricks.FieldGroup = class {
|
|||||||
i18n:true});
|
i18n:true});
|
||||||
box.add_widget(txt);
|
box.add_widget(txt);
|
||||||
box.set_id(fields[i].name + '_box')
|
box.set_id(fields[i].name + '_box')
|
||||||
if (fields[i].nonuse))
|
if (fields[i].disabled))
|
||||||
box.disabled(true);
|
box.disabled(true);
|
||||||
}
|
}
|
||||||
var w = Input.factory(fields[i]);
|
var w = Input.factory(fields[i]);
|
||||||
@ -252,15 +252,13 @@ bricks.FormBase = class extends bricks.Layout {
|
|||||||
w.disabled(flg);
|
w.disabled(flg);
|
||||||
if (flg) return;
|
if (flg) return;
|
||||||
this.exclusionfields.forEach(arr =>{
|
this.exclusionfields.forEach(arr =>{
|
||||||
if (arr.include(field_name)){
|
if (arr.include(field_name)){
|
||||||
arr.forEach(x => {
|
arr.forEach(x => {
|
||||||
if (x!=field_name){
|
if (x!=field_name){
|
||||||
var w1 = bricks.getWidgetById(x + '_box', this);
|
var w1 = bricks.getWidgetById(x + '_box', this);
|
||||||
if (w1) {
|
if (w1) w1.disabled(! flg);
|
||||||
w1.disabled(! flg);
|
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -278,7 +276,6 @@ bricks.FormBase = class extends bricks.Layout {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var w = this.name_inputs[name];
|
var w = this.name_inputs[name];
|
||||||
if (w.parent.is_disabled()) continue;
|
|
||||||
var d = w.getValue();
|
var d = w.getValue();
|
||||||
if (w.required && ( d[name] == '' || d[name] === null)){
|
if (w.required && ( d[name] == '' || d[name] === null)){
|
||||||
new bricks.Error({title:'Requirement', message:'required field must input"' + w.label + '"'})
|
new bricks.Error({title:'Requirement', message:'required field must input"' + w.label + '"'})
|
||||||
@ -362,19 +359,8 @@ bricks.Form = class extends bricks.FormBase {
|
|||||||
toolbar:
|
toolbar:
|
||||||
submit_url:
|
submit_url:
|
||||||
method:
|
method:
|
||||||
exclussionfields:[
|
|
||||||
[a,b,c],
|
|
||||||
[x,y]
|
|
||||||
]
|
|
||||||
fields
|
fields
|
||||||
}
|
}
|
||||||
field {
|
|
||||||
name:
|
|
||||||
label:
|
|
||||||
uitype:
|
|
||||||
nonuse: # 不使用
|
|
||||||
...
|
|
||||||
}
|
|
||||||
*/
|
*/
|
||||||
constructor(opts){
|
constructor(opts){
|
||||||
opts.height = "100%";
|
opts.height = "100%";
|
||||||
|
|||||||
@ -94,9 +94,6 @@ bricks.JsWidget = class {
|
|||||||
observable(name, value){
|
observable(name, value){
|
||||||
return new bricks.Observable(this, name, value);
|
return new bricks.Observable(this, name, value);
|
||||||
}
|
}
|
||||||
is_disabled(){
|
|
||||||
return this.dom_element.disabled == true;
|
|
||||||
}
|
|
||||||
disabled(flag){
|
disabled(flag){
|
||||||
if(flag){
|
if(flag){
|
||||||
this.dom_element.disabled = true;
|
this.dom_element.disabled = true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user