Successfully!

Error!

You are viewing 10.0 help doc. More details are displayed in the latest help doc

JS Hide sheet page

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:

1.png

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 .

2.png

$(".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:

3.png


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.

4.png

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:

5.png


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":

6.png

$('.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:

7.png

III. Download template

Attachment List


Theme: Secondary Development
Already the First
Already the Last
  • Helpful
  • Not helpful
  • Only read

Doc Feedback