FineReport Community

Title: How to use JavaScript to get widgets [Print this page]

Author: ConnieWang    Time: 2020-5-15 09:59
Title: How to use JavaScript to get widgets
Is there any who is familiar with the ways to get widgets and read their values using JavaScript?

Author: Cherly    Time: 2020-5-15 10:04
1-Pagination Preview

a-Get parameter panel widget in parameter panel:this.options.form.getWidgetByName("a");
b-Get the parameter panel widget in the table:_g().parameterEl.getWidgetByName("a");

2-Data Entry Preview
a-Get parameter panel widget in parameter panel:this.options.form.getWidgetByName("a");
b-Get the parameter panel widget in the table:_g().parameterEl.getWidgetByName("a");
c-Parameter panel to get the widgets in the table:contentPane.getWidgetByName("a");  OR
contentPane.getWidgetByCell("A1");
d-Get the widgets in the table:
contentPane.getWidgetByName("a");  OR
contentPane.getWidgetByCell("A1");

3-Dashboard Preview
a-Get parameter panel widget in parameter panel:this.options.form.getWidgetByName("a");
b-Parameter panel to getwidgets:
_g().getWidgetByName("a");
c-The widget in the body gets the parameter panel widget:_g().parameterEl.getWidgetByName("a");
d-The widgets in the body get each other:
_g().getWidgetByName("a");
e-Report block to get the widgets in the body:
window.form=this.options.form;
window.form.getWidgetByName("report0");
Tip: All JS is just to get the widget, if you need to get the value of the widget, please add getValue (), if you need to assign a value to the widget, please add setValue ().




Welcome to FineReport Community (https://community.finereport.com/) Powered by Discuz! X3.2