getWidgetByName
| Method | getWidgetByName(name) | Get the widget in the data entry cell by the widget name |
|---|---|---|
| Parameter | name: string | widget name, string Note: The widget in the cell has no name by default, you can add it at "Widget Name". |
| Return value | object | Thewidget object, which needs to be used in combination with the attributes/methods of the widget. When the cell is expanded, it returns the first widget in the found widget array. |
| Example | Example 1: If the obtained report object is defined as report, get the drop-down box widget comboBox0 in the cell Example 2: In a general report, get the drop-down box widget comboBox0 in the cell _g().getWidgetByName("comboBox0"); | |
Application example | When entering data in the report, the grade is only allowed to be entered once, and after entering the value in the grade widget, it is set as disabled: Click to download the template: Set to disabled after the widget has entered a value.cpt
| |
| Mobile | Support mobile terminal | |
getWidgetByCell
| Method | getWidgetByCell(cell) | Get the widget in the data entry cell through the cell address |
|---|---|---|
| Parameter | cell:string | cell address, string |
| Return value | object | The widget object needs to be used in combination with the attributes/methods of the widget. When the cell is expanded, only one widget is returned, and the cell corresponds to the number of the expanded cell. |
| Example | Example 1: If the obtained report object is defined as report , obtain the drop-down box widget in cell A1 of the report Example 2: In data entry report, get the drop-down box widget in cell A1 _g().getWidgetByCell("A1"); | |
Application example | When entering data in the report, the grade is only allowed to be entered once. After getting the input value of the widget in cell B4, set it to disabled: Click to download the template: Set to disabled after the widget has entered a value(obtain by cell address).cpt
| |
| Mobile | Support mobile terminal | |
getWidgetsByName
| Method | getWidgetsByName(name) | Get the widget with the same name in the data entry cell by the widget name |
|---|---|---|
| Parameter | name: string | widget name, string Note: The widget in the cell has no name by default, you can add it at "Widget Name". |
| Return value | [object ] | Array of widget objects, which needs to be used in combination with the attributes/methods of the widget; when the cell is expanded, it returns an array of widget objects |
| Example | Example 1: If the obtained report is defined as report, get all the drop-down box widgets named comboBox0 in the cell Example 2: In a general report, get all the drop-down box widgets named comboBox0 in the cell _g().getWidgetsByName("comboBox0"); | |
Application example | When entering data in the report, click the button to get all the values of the radio button group widgets extension: For detailed implementation methods, please refer to:JS Get all values of extended widget
| |
| Mobile | Support mobile terminal | |
appendReportRC
| Method | appendReportRC(num,cell) | Insert a row at a specific position, the specified cell needs to set the extended attribute |
|---|---|---|
| Parameter | num:number cell:string | num:number of rows inserted, number cell:The cell number of the insertion position. If there is no such parameter, the insertion position is the row where the mouse focus is located |
| Return value | void | |
| Example | Example 1: If the obtained report object is defined as report , insert 3 rows after the row of cell A1 of the report Example 2: In the data entry report, insert 3 rows after the row of cell A1 in the report _g().appendReportRC(3,"A1"); | |
Application example | When entering data in the report, click the button to insert the custom number of rows: Click to download the template: Insert a Specified Number of Rows.cpt
| |
| Mobile | Not support mobile terminal | |
appendReportRow
| Method | _g().appendReportRow(cell,sheetindex,num) | To insert a row, it needs to be implemented with the "Insert Row Button" Note: When using the num parameter, try to adjust the number of rows of the insert row button to 0, which will affect each other and cause confusion |
|---|---|---|
| Parameter | cell:string sheetindex:number num:number | cell:The number of the cell where the "Insert Row Button" is located, string sheetindex:sheet number, number, starting from 0 num:number of rows inserted, number |
| Return value | void | |
| Example | Example 1: If the obtained report object is defined as report , the insert row button is in the "F1" cell of "sheet1", and 3 rows are inserted Example 2: In the data entry report, insert row button in the "F1" cell of "sheet1", insert 3 rows Example 3: After getting the insert row button and sheet number through this.options.location, this.options.reportIndex, insert 3 rows Example 4: In the data entry report, after obtaining the insert row button and sheet number through this.options.location, this.options.reportIndex, insert 3 rows _g().appendReportRow(this.options.location,this.options.reportIndex,3); | |
Application example | When entering data in the report, click the button to insert the custom number of rows: For detailed implementation methods, please refer to:JS Insert Customized Number of Rows
| |
| Mobile | Support mobile terminal | |
deleteReportRC
| Method | deleteReportRC(cell) | delete row |
|---|---|---|
| Parameter | cell:string | cell:The cell number of the delete location. If there is no such parameter, the delete position is the row where the mouse focus is located |
| Return value | void | |
| Example | Example 1: If the obtained report object is defined as report , delete the row where the A1 cell is located Example 2: In the data entry report, delete the row where the A1 cell is located Example 3: In the data entry report, delete the row at the cell position where the mouse is located _g().deleteReportRC(); | |
Application example | When entering data in the report, click the button to delete the cell row where the mouse is located: For detailed implementation methods, please refer to:JS custom insert and delete row buttons
| |
| Mobile | Not support mobile terminal | |
deleteRows
| Method | deleteRows([cell]) | delete row |
|---|---|---|
| Parameter | cell:string | cell:Array of cell numbers for delete positions |
| Return value | void | |
| Example | Example 1: If the obtained report object is defined as report , delete the row where cells A1 and A2 are located Example 2: In the data entry report, delete the row where cells A1 and A2 are located _g().deleteRows(['A1','A2']); | |
Application example | In the data entry report, realize batch deletion according to the options: For detailed implementation methods, please refer to:JS implements check button control selection and batch operations
| |
| Mobile | Not support mobile terminal | |
refreshAllSheets
| Method | refreshAllSheets() | Re-query, refresh all sheets, after refresh, it will stay on the last viewed sheet |
|---|---|---|
| Parameter | - | - |
| Return value | void | |
| Example | Example 1: If the obtained report object is defined as report , refresh all sheets Example 2: In the data entry report, refresh all sheets _g().refreshAllSheets(); | |
Application example | Click the button to refresh all sheets, and still stay in the current sheet3 after refreshing: Click to download the template: Stay in the current sheet after refreshing.cpt
| |
| Mobile | Support mobile terminal | |
loadSheetByIndex
| Method | loadSheetByIndex(index) | Switch to the specified sheet, the parameter is the sheet number |
|---|---|---|
| Parameter | index:number | index:sheet number (starting from 0) |
| Return value | void | |
| Example | Example 1: If the obtained report object is defined as report , switch to the second sheet Example 2: In the data entry report, switch to the second sheet _g().loadSheetByIndex(1); | |
Application example | If there are multiple sheet pages in the report, when previewing, the second sheet page is displayed by default: Click to download the template: Display a specific sheet by index.cpt
| |
| Mobile | Not support mobile terminal | |
loadSheetByName
| Method | loadSheetByName(name) | Switch to the specified sheet, the parameter is the sheet name |
|---|---|---|
| Parameter | name:string | name:sheet name |
| Return value | void | |
| Example | Example 1: If the obtained report object is defined as report , switch to the sheet named "Commodity" Example 2: In the data entry report, switch to the sheet named "Commodity" _g().loadSheetByName("Commodity"); | |
Application example | If there are multiple sheet pages in the report, when previewing, the sheet page named "sheet2" is displayed by default: Click to download the template: Display a specific sheet by name.cpt
| |
| Mobile | Not support mobile terminal | |
writeReport
| Method | writeReport(sheetindex) | Force commit, no verification |
|---|---|---|
| Parameter | sheetindex:number | The number of sheets to submit, number, starting from 0, if the parameter is empty, it means submitting all sheets |
| Return value | void | |
| Example | Example 1: If the obtained report object is defined as report , submit the second sheet Example 2: In the data entry report, submit the second sheet _g().writeReport(1); | |
Application example | Customize a "Submit" button to submit the filling content when the button is clicked: Click to download the template: Mandatory submission without verification.cpt
| |
| Mobile | Support mobile terminal | |
verifyAndWriteReport
| Method | verifyAndWriteReport(isallsheet) | Verify and submit reports |
|---|---|---|
| Parameter | isallsheet:boolean | isallsheet:whether to submit all sheets
|
| Return value | void | |
| Example | Example 1: If the obtained report object is defined as report , submit all sheets Example 2: In the data entry report, determine whether to enable automatic temporary storage _g().verifyAndWriteReport(true); | |
Application example | Customize a "Submit" button to verify the submitted content when the button is clicked: Click to download the template:
| |
| Mobile | Support mobile terminal | |
verifyReport
| Method | verifyReport() | Data verification |
|---|---|---|
| Parameter | - | - |
| Return value | void | |
| Example | Example 1: If the obtained report object is defined as report , submit for verification Example 2: In the data entry report and submit it for verification _g().verifyReport(); | |
Application example | Customize a "Verify" button to submit the verification when the button is clicked: Click to download the template:
| |
| Mobile | Support mobile terminal | |
importExcel
| Method | importExcel(importStyle) | Import Excel |
|---|---|---|
| Parameter | importStyle: | Import method, string
|
| Return value | void | |
| Example | Example 1: If the obtained report object is defined as report , call up the function pop-up window for importing Excel, and import Excel in the normal import method Example 2: In the data entry report, call up the pop-up window of the import Excel function, and import Excel in the normal import method Example 3: In the data entry report, call up the pop-up window of the import Excel function, and import Excel in a custom import method _g().importExcel("customize"); | |
Application example | Customize a "Import Excel" button, click to import Excel: Click to download the template: Import excel with custom import method.cpt
| |
| Mobile | Not support mobile terminal | |
importExcel_Clean
| Method | importExcel_Clean() | Import Excel with "Clean Import" |
|---|---|---|
| Parameter | - | - |
| Return value | void | |
| Example | Example 1: If the aobtained report object is defined as report , call up the pop-up window of the import Excel function, and import Excel in the way of "clean import" Example 2: In the data entry report, call up the pop-up window of the import Excel function, and import Excel in the way of "clean import" _g().importExcel_Clean(); | |
Application example | Customize a "Import Excel" button, click to import Excel in the way of "Clean Import": Click to download the template: Import excel with clean import method.cpt
| |
| Mobile | Not support mobile terminal | |
importExcel_Append
| Method | importExcel_Append() | Import Excel by means of "append import" |
|---|---|---|
| Parameter | - | - |
| Return value | void | |
| Example | Example 1: If the obtained report object is defined as report , call up the import Excel function pop-up window, and import Excel by append import Example 2: In the data entry report, call up the pop-up window for importing Excel function, and import Excel in append import mode _g().importExcel_Append(); | |
Application example | Customize a "Import Excel" button, click to import Excel with append way: Click to download the template: Import excel with append import method.cpt
| |
| Mobile | Not support mobile terminal | |
importExcel_Cover
| Method | importExcel_Cover() | Import Excel by the means of "Cover Import" |
|---|---|---|
| Parameter | - | - |
| Return value | void | |
| Example | Example 1: If the obtainedreport object is defined as report , call up the Import Excel: function pop-up window, and import Excel by covering the import Example 2: In the data entry report, call up the Import Excel: function pop-up window, and import Excel by covering the import _g().importExcel_Cover(); | |
Application example | Customize a "Import Excel" button and click to import Excel by covering the import: Click to download the template: Import excel with cover import method.cpt
| |
| Mobile | Not support mobile terminal | |
isDirtyPage
| Method | isDirtyPage() | Determine if a page has been edited |
|---|---|---|
| Parameter | - | - |
| Return value | boolean | Whether the page has been edited, boolean
|
| Example | Example 1: If the obtained report object is defined as report , determine whether the page has been edited Example 2: In the data entry report, determine whether the page has been edited _g().isDirtyPage(); | |
Application example | Click the button to determine whether the page has been edited: Click to download the template:
| |
| Mobile | Not support mobile terminal | |
isAutoStash
| Method | isAutoStash() | To determine whether to enable automatic temporary storage, please refer to: Data Entry Stash |
|---|---|---|
| Parameter | - | - |
| Return value | boolean | Whether to enable automatic stash, boolean
|
| Example | Example 1: If the obtained report object is defined as report , determine whether to enable automatic stash Example 2: In the data entry report, determine whether to enable automatic stash _g().isAutoStash(); | |
Application example | - | |
| Mobile | Not support mobile terminal | |
stash
| Method | stash(undefined,true) | stash |
|---|---|---|
| Parameter | undefined,true | Fixed format, which is used to pop up a prompt for successful stash. If you don't need a prompt, just don't write it. |
| Return value | void | |
| Example | Example 1: If the obtained report object is defined as report , stash and pop up a prompt that the stash is successful Example 2: In the data entry report, stash and pop up a prompt that the stash is successful Example 3: In the data entry report, stash and doesn't pop up a successful stash prompt_g().stash(); | |
Application example | - | |
| Mobile | Not support mobile terminal | |
clear
| Method | clear() | clear stash |
|---|---|---|
| Parameter | - | None, if you do not need to clear the confirmation reminder and clear the successful prompt, you can write undefined,false |
| Return value | void | |
| Example | Example 1: If the aobtained report object is defined as report , clear the stash and pop up a prompt to clear the stash successfully Example 2: In the data entry report, clear the stash and pop up a prompt that the stash is cleared successfully Example 3: In the data entry report, the stash is cleared but the clearing confirmation reminder and clearing success prompt do not pop up _g().clear(undefined,false); | |
Application example | - | |
| Mobile | Not suppory mobile terminal | |
