()
| 98 | |
| 99 | // 检查输入项的有效性,在表单提交时调用 |
| 100 | check_valid(): boolean { |
| 101 | let valid = !Number.isNaN(this.get_value()) || this.element.find('input').val() === ''; |
| 102 | if (!valid) { |
| 103 | this.update_input_helper(-1, { |
| 104 | 'valid_status': false |
| 105 | }); |
| 106 | } else { |
| 107 | this.update_input_helper(-1, { |
| 108 | 'valid_status': 0, // remove the valid status |
| 109 | }); |
| 110 | } |
| 111 | return valid; |
| 112 | } |
| 113 | |
| 114 | update_input(spec: any): any { |
| 115 | let attributes = spec.attributes; |
no test coverage detected