Comments (6)
Hello,
I'm using this very interesting plugin!
Also my use case needs a custom onChange for a SELECT field, I would really appreciate an example.
Thank you,
Fabrizio
from volkovlabs-form-panel.
It will be very helpful. Please do it.
@ftasso, Thank you, I will look into custom
onChange
events.I am thinking of implementing a Custom Code for the
onOptionsChange
event, which will allow to create dynamic forms.
from volkovlabs-form-panel.
Hello @lynhnn,
This is how we define SELECT elements. It has predefined onChange event, which updates selected value in Options.
{element.type === FormElementType.SELECT && (
<InlineField
label={element.title}
grow={!!!element.width}
labelWidth={element.labelWidth}
tooltip={element.tooltip}
transparent={!!!element.title}
>
<Select
value={element.value}
onChange={(event: SelectableValue) => {
element.value = event?.value;
onOptionsChange(options);
}}
width={element.width}
options={element.options || []}
className={highlightClass(element)}
/>
</InlineField>
)}
Do you want to have you own custom onChange function? Will it help you?
from volkovlabs-form-panel.
@ftasso, Thank you, I will look into custom onChange
events.
I am thinking of implementing a Custom Code for the onOptionsChange
event, which will allow to create dynamic forms.
from volkovlabs-form-panel.
We implemented various JavaScript hooks and refactoring element states in v3.
from volkovlabs-form-panel.
We implemented various JavaScript hooks and refactoring element states in v3.
Any example for this? I checked the commits and didn't find anything related to this use case. Currently onchange is a function to change element, rather than a event trigger which will be called on element's value has changed.
Solved by using Show if returned value is true
, tricky but works.
Example:
const list = elements.find(
(element) => element.id === 'list'
);
const count = elements.find(
(element) => element.id === 'count'
);
if (list) {
count.value = list.value.split('\n').length + "";
}
return true;
from volkovlabs-form-panel.
Related Issues (20)
- Request Boundary missing when trying to upload the file HOT 3
- Get géolocalisation of th user as variable to insert in database HOT 1
- Get géolocalisation of th user as variable to insert in database HOT 1
- Is my use case suitable?
- elements is not defined HOT 1
- Monaco code editor Psql language
- Radio group and code dont appear to have hide or unhide properties HOT 1
- Syntax error in documentation
- Search greyed out HOT 1
- Sometimes slow performance HOT 1
- Add elements group HOT 1
- Remove existing rows from a table HOT 1
- Add File option to upload single or multiple files
- Adding custom color/background color for elements
- Panel multi select not hiding correctly HOT 2
- Panel "Submit" halts and raises "Uncaught (in promise)" HOT 3
- Question: Http POST very slow, take too much time HOT 1
- Add new element MultiSelect list HOT 4
- Prepare for Grafana 11
- Initial action of Datasource and custom code HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from volkovlabs-form-panel.