Customize inputs
RichFunctionView supports custom inputs. You can create your own input and use it via the special input
tag.
Much like a validator function, custom input also should be returned by Datagrok function.
caution
Custom input functions should be written in JavaScript.
Here is an example of a custom input for string values. It behaves exactly the same as the default string input
but has aqua
background color.
- Result
- Custom input
- Using a custom input
package.ts
//name: CustomStringInput
//input: object params
//output: object input
export function CustomStringInput(params: any) {
const defaultInput = ui.input.string('Custom input', {value: ''});
defaultInput.root.style.backgroundColor = 'aqua';
defaultInput.input.style.backgroundColor = 'aqua';
return defaultInput;
}
Your script header
//input: string test {input: Compute:CustomStringInput }