* Remove a field from this input. * * @param name The name of the field. * @param opt_quiet True to prevent an error if field is not present. * @returns True if operation succeeds, false if field is not present and * opt_quiet is true. * @throws {Error} if the field is not pres
(name: string, opt_quiet?: boolean)
| 145 | * @throws {Error} if the field is not present and opt_quiet is false. |
| 146 | */ |
| 147 | removeField(name: string, opt_quiet?: boolean): boolean { |
| 148 | for (let i = 0, field; (field = this.fieldRow[i]); i++) { |
| 149 | if (field.name === name) { |
| 150 | field.dispose(); |
| 151 | this.fieldRow.splice(i, 1); |
| 152 | if (this.sourceBlock.rendered) { |
| 153 | (this.sourceBlock as BlockSvg).queueRender(); |
| 154 | } |
| 155 | return true; |
| 156 | } |
| 157 | } |
| 158 | if (opt_quiet) { |
| 159 | return false; |
| 160 | } |
| 161 | throw Error('Field "' + name + '" not found.'); |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * Gets whether this input is visible or not. |
no test coverage detected