I. Overview
1.1 Problem
In view of the fact that there are many sheet pages to be reported, some sheet pages do not need to be displayed, or they are directly hidden.
1.2 Solution
This is achieved by adding a loading end event in the data entry web attribute.
II. Example
There are two ways to hide the sheet page, one is by coordinates, and the other is by name.
Note: The sheet page name can contain variables.
2.1 Hide sheet page by coordinates
The sheets contained in the template are as follows, including three named sheets and one empty sheet:
Click Template> Template Web Attributes>Data Entry Settings in the menu bar , select "individually set for this template", and add a "Loading End Event":
Note: You need to change the variable "index" to a number, starting from 0, which represents the first sheet page .
$(".html-content").eq(index).hide();//Hide content
$(".fr-tabpane-tabswrap > li").eq(index).hide();//Hide buttons
$(".fr-tabpane-tabswrap > li").eq(index+1).click();//Click to the next sheet
Save the template and preview it, you can see that sheet1 is hidden:
2.2 Hide sheet page by name
Click Template> Template Web Attributes>Data Entry Settings in the menu bar , select "individually set for this template", and add a "Loading End Event":
Note: You need to change the variable"SHEET NAME" to the name of the sheet to be hidden.
var sheet_name="SHEET NAME";
var $sheet=$("li[title="+sheet_name+"]");
if($sheet.find("span").hasClass("fr-sheetbutton-endpart")){
$sheet.prev().find("span[class='fr-sheetbutton-thirdpart']").attr("class","fr-sheetbutton-endpart");
};
$sheet.remove();
Save the template and preview it, you can see that the sheet named sheet2 is hidden:
2.3 Dynamically hide empty sheets
Click Template> Template Web Attributes>Data Entry Settings in the menu bar , select "individually set for this template", and add a "Loading End Event":
$('.fr-sheetbutton-middlepart').each(function(index,e){
if(e.innerHTML==''){
$('[title=""]').hide()
}
})
After saving the template and clicking the Data Entry preview , you can see that the empty sheet pages are hidden: