Mobile blank filling method and system for components on right side and below after components are hidden in dynamic table

By identifying component permissions in dynamic tables and performing loop traversal and rendering, the problem of component movement and emptying after hidden components is solved, improving the aesthetics and information density of the table, realizing the effective hiding of the component and the integrity of the table format.

CN119047443APending Publication Date: 2024-11-29中孚安全技术有限公司 +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411101721.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

When hiding table components, the problems caused by blank cells and rows and columns are affected by the aesthetics and information density of the table, especially when the component moves to the right or below the component after the component is hidden, the processing of the emptying of the component is not thorough.

Method used

By adding hidden variables to identify component permissions in dynamic tables, and using for loops to traverse rows and columns, compute and display supplementary blank cells, filter out rows of visible components for rendering, to achieve left shift of components and up shift of rows, The centrally visible component is in the upper left of the table.

Benefits of technology

It effectively solves the problems of the left shift of the component on the right side after the hidden component and the hidden row shift upward, improves the aesthetics and information density of the table, and ensures the overall format integrity of the table.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119047443A_ABST
    Figure CN119047443A_ABST
Patent Text Reader

Abstract

The invention provides a method and a system for moving blank filling of components on the right side and below after components are hidden in a dynamic table, and relates to the technical field of dynamic table editing.A dynamic table is initialized, and a hidden variable used for identifying component permission is added to each component in the dynamic table; rendering the dynamic table by using various labels; traversing rows of the dynamic table by using for circulation, traversing each column by using for circulation for each row, and displaying the cells fixed at the original positions and the components in the cells; for each row, calculating the number of right-side supplementary blank cells, and continuously displaying empty cells with the same number as the right-side supplementary blank cells in the row; and changing the traversing mode of the for circulation, not traversing all rows in the dynamic table any more, screening out the rows with the visible components, circularly traversing the rows of the visible components, and displaying the rows of the visible components.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of dynamic table editing, and in particular to a method and system for moving components on the right and below to fill in blanks after components are hidden in a dynamic table. Background Art

[0002] The statements in this section merely provide background information related to the present disclosure and do not necessarily constitute prior art.

[0003] Tables are one of the common ways to collect and display data on the front end. Place components (such as titles, text content, input boxes, drop-down selections, cascading selections, etc.) or a combination of components in the table, and merge cells according to business requirements. In order to make certain components in the table visible to people (or roles) who meet certain conditions, while others cannot see them, so that different people or roles can see different table contents, each component in the table needs to support the setting of visibility permissions.

[0004] When the permission of a component in a table is set to invisible, that is, when a component is hidden, the existing solution is to directly not render the component, and the content of one or more cells where the component is located will be displayed as blank. When the hidden component is on the left side of a column or above a row in the table, and there are normally displayed components on the right or below, the blank cells caused by hiding look like a piece of the table is missing; when all components in a row or column are hidden, the row or column will become a blank row; whether it is a blank space in the upper left corner or a blank row, it will cause the overall format to be uneven and affect the beauty of the table. Summary of the invention

[0005] In order to solve the above problems, the present disclosure proposes a method and system for moving and filling the blanks of components on the right and below after hiding components in a dynamic table. When the permission of a component in the table is set to be invisible and the space occupied by the component can accommodate the component on the right, the component on the right is moved to the left to fill the blanks; when the permission of no component in a row of the table is visible, that is, there is no component that can be displayed, the row below is moved up to fill the blanks, so that the visible components can be placed in the upper left corner of the table as much as possible, thereby improving the density of information and the aesthetics of the table.

[0006] According to some embodiments, the present disclosure adopts the following technical solutions:

[0007] The method to move and fill the gaps on the right and bottom of the dynamic table after hiding the components includes:

[0008] Initialize the dynamic table and add a hidden variable for identifying component permissions to each component in the dynamic table;

[0009] Use a for loop to traverse the rows of the dynamic table. For each row, use a for loop to traverse each column to display the cells and components in the cells fixed at the original position.

[0010] For each row, calculate the number of blank cells filled on the right, and continue to display the same number of empty cells in the row as the number of blank cells filled on the right;

[0011] The traversal mode of the for loop is changed. Instead of traversing all rows in the dynamic table, the rows with visible components are screened out, the rows of visible components are traversed in a loop and displayed, and the dynamic table is rendered using various tags.

[0012] According to some embodiments, the present disclosure adopts the following technical solutions:

[0013] After the dynamic table hides the components, the right and bottom components move to fill the gaps, including:

[0014] The initialization module is used to initialize the dynamic table and add a hidden variable for identifying the component permissions to each component in the dynamic table;

[0015] The traversal module is used to use a for loop to traverse the rows of the dynamic table. For each row, a for loop is used to traverse each column to display the cells and components in the cells fixed at the original position.

[0016] For each row, calculate the number of blank cells filled on the right, and continue to display the same number of empty cells in the row as the number of blank cells filled on the right;

[0017] The display module is used to change the traversal mode of the for loop. Instead of traversing all rows in the dynamic table, the rows with visible components are selected, and the rows with visible components are traversed and displayed in a loop.

[0018] The rendering module is used to render dynamic tables using various tags.

[0019] Compared with the prior art, the present invention has the following beneficial effects:

[0020] The disclosed method for moving and filling blank spaces on the right and bottom of a dynamic table after hiding components is to first display visible components and then fill blank cells on the right, thereby concentrating the visible components on the left side of the table, thereby achieving the effect of moving the right components to the left to fill blank spaces after hiding components; and by only displaying rows with visible components, achieving the effect of moving the bottom rows upward after hiding all components in the rows.

[0021] The disclosed method for moving and filling the gaps in the right and lower components after hiding components in a dynamic table is as follows: when the permission of a component in the table is set to invisible and the space occupied by the component can accommodate the right component, the right component moves left to fill the gap; when the permission of no component in a row of the table is visible, that is, there is no component that can be displayed, the lower row moves up to fill the gap. This method can place the visible components in the upper left corner of the table as much as possible to improve the density of information. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings constituting a part of the present disclosure are used to provide a further understanding of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure.

[0023] Figure 1 is a method flow chart of an embodiment of the present disclosure;

[0024] Figure 2 A schematic diagram of a dynamic table according to an embodiment of the present disclosure;

[0025] Figure 3 This is a diagram showing the effect of hiding the name and the name input box below, hiding the hobbies and the hobby input box below in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] The present disclosure is further described below in conjunction with the accompanying drawings and embodiments.

[0027] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present disclosure belongs.

[0028] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present disclosure. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0029] Example 1

[0030] In one embodiment of the present disclosure, a method for moving components on the right and below to fill in the blanks after components are hidden in a dynamic table is provided. When the permission of a component in the table is set to invisible and the space occupied by the component can accommodate the component on the right, the component on the right moves to the left to fill in the blanks; when the permission of no component in a row of the table is visible, that is, there is no component that can be displayed, the row below moves up to fill in the blanks. This method can place visible components in the upper left corner of the table as much as possible, thereby improving the density of information and the aesthetics of the table. It includes:

[0031] Step 1: Initialize the dynamic table and add a hidden variable for identifying component permissions to each component in the dynamic table;

[0032] Step 2: Use a for loop to traverse the rows of the dynamic table. For each row, use a for loop to traverse each column to display the cells and components in the cells fixed at the original position.

[0033] Step 3: For each row, calculate the number of blank cells to be filled on the right, and continue to display the same number of empty cells in the row as the number of blank cells to be filled on the right;

[0034] Step 4: Change the traversal mode of the for loop. Instead of traversing all rows in the dynamic table, select the rows with visible components, traverse the rows of visible components and display them;

[0035] Step 5: Render the dynamic table using various tags.

[0036] As an embodiment, the specific implementation process of the method for moving and filling the gaps of components on the right and below after hiding components in a dynamic table disclosed in the present invention includes:

[0037] Step S0: Initialize dynamic table

[0038] Specifically, the data structure of the dynamic table generated by the form designer is as follows: columns are nested in rows, cells are nested in columns, and components are nested in cells. Each cell has rowspan and colspan attributes to record the merged cell situation, where rowspan records the number of merged rows and colspan records the number of merged columns.

[0039] When multiple cells are merged into a whole, the rowspan of these cells are the same, which is equal to the number of merged rows, and the colspan is the same, which is equal to the number of merged columns. When there is a component in the merged cell, the component data is placed in the cell in the upper left corner of the merged cell, and the merge attribute of this cell is false, and the merge attribute of other merged cells is true. It can be considered that the cells with merge as true are merged by the component, so that the component can occupy the entire space of the merged cell when displayed. For example: merge 3 adjacent rows and 4 columns, a total of 12 cells, into a whole, then the rowspan of these 12 cells are all equal to 3, the colspan is all equal to 4, the component data is placed in the upper left cell, the merge attribute of the upper left cell is false, and the merge attribute of the other 11 cells is true, and the component occupies the space of 3 rows and 4 columns, a total of 12 cells.

[0040] Based on the data structure of the dynamic table described in step S0, the following steps S1 to S10 are used to implement a method for moving components on the right and below to fill in the gaps after hiding components in the dynamic table.

[0041] Among them, steps S1 to S9 introduce the steps of moving the right component to the left after realizing the dynamic table hiding component. The overall idea is that for each row of data, first display the components with visible permissions or other cells that need to be fixed in place. When the number of cells displayed in the row is less than the number of columns in the table, there will be blank spaces on the right side of the row. In this case, blank cells are added on the right side of the row to make the table display complete. Step S10 introduces the steps of moving the lower component up after realizing the dynamic table hiding component. The overall idea is to only display rows containing components with visible permissions. The specific steps are as follows:

[0042] Step S1: Add a hidden variable to each component in the dynamic table to identify the permissions of the component.

[0043] When hidden is equal to false, the permission is visible, and when hidden is equal to true, the permission is invisible.

[0044] Step S2: Using HTML

[0045]

[0056]

[0057]

[0058]

[0059]

[0060]

[0061]

[0062]

[0063]

[0064]

[0065]

[0066]

[0067]

[0068]

[0069]

[0070]

[0071]

[0072]

[0073] Figure 1 Figure 1

[0074] Figure 1 Figure 1

[0075] The tag renders a dynamic table. The tag renders the body of the table. Tags render dynamic table rows, Tags and set rowspan and colspan attributes to render dynamic table cells.

[0046] Step S3: Use a for loop to traverse the rows of the dynamic table.

[0047] Step S4: For each row, use a for loop to traverse the columns to display the cells fixed at the original positions and the components in the cells.

[0048] Specifically, the cells that are fixed in place include:

[0049] (1) The cell where the visible component is located and its merged cells;

[0050] (2) The authority is an invisible component, but the space occupied by the component on the right is larger than that of the invisible component, and the component on the right cannot be moved over. The cells occupied by the invisible component and the cells merged by it.

[0051] Specifically, a for loop is used to traverse each column. If the merge attribute of the cell in the column is false, step S5 is executed. If the merge attribute is true, step S7 is executed.

[0052] Step S5: There are three cases when the merge attribute of a cell is equal to false: (1) there is no component in the cell; (2) there is a component in the cell and the permission of the component is visible; (3) there is a component in the cell and the permission of the component is invisible.

[0053] When there is no component in the cell, it may be that the user did not put the component in the cell when designing the form due to his own preference or the aesthetics of the layout. The user designed it this way. In this case, the cell needs to be fixed in place and displayed as it is.

[0054] Specifically, use Label and give The rowspan of the label is assigned the rowspan of the cell. The colspan of the label is assigned to the colspan of the cell, and cell is used to represent the data of the cell. If there is no component in the cell, use the following code to display the cell.

[0055] <td:rowspan=”cell.rowspan”:colspan=”cell.colspan”> In case 2: There is a component in the cell, and the component permission is visible, it is displayed as is, and the component code is written in Tags and Between the tags, that is:<td:rowspan=”cell.rowspan”:colspan=”cell.colspan”> The code for rendering components is written here. In case three: there is a component in the cell, and the component's permission is invisible, if the space occupied by the component on the right is larger than the invisible component and the component on the right cannot be moved, the cell will be fixed in place and a cell will be displayed directly, that is <td rowspan=”1”colspan=”1”> , the following step S6 describes how to determine whether a cell is fixed in place when there is a component in the cell and the component permission is invisible. If the cell is not fixed in place, no operation is performed, that is, the cell is not displayed. Step S6: When there is a component in the cell and the component permission is invisible, the following steps are used to determine whether the cell is fixed in place. In this step, the cell that needs to be determined whether it is fixed in place is called the source cell: ① According to the row number and column number of the source cell and the table data, find the first cell on the right side of the source cell without a component, or the cell on the right side where the first component with visible permission is located. In this step, the found cell is called the target cell; ② If the merge attribute of the target cell is true, the source cell is fixed in place; if the merge attribute of the target cell is false, and its rowspan is greater than the rowspan of the source cell, the source cell is fixed in place. In other cases, the source cell is not fixed in place. Step S7: When the merge attribute of a cell is equal to true, it means that this cell is a merged cell. Find the cell where the component that merges this cell is located. According to step S6, determine whether the found cell is fixed in place. If so, the current cell is also fixed in place, and a cell is directly displayed, that is, <td rowspan=”1”colspan=”1”> . Step S8: The detailed steps for finding the cell (target cell) where the component of a merged cell (source cell) described in step S7 is located are as follows: ① According to the row number, column number, rowspan, colspan and table data of the source cell, filter out the rowspan row in the upper left corner of the source cell, and the colspan column has a total of rowspan*colspan cells; ② Find a cell with component data, merge attribute equal to false, colspan attribute equal to source cell colspan, and rowspan equal to source cell rowspan in these rowspan*colspan cells. This cell is the target cell. Step S9: Steps S1 to S8 have displayed the components or cells that need to be displayed in the row, but the cells are not displayed in the case of invisible components with permissions and components on the right that can be moved over. The right side of the row is blank because no cells are displayed. At this time, it is necessary to add cells on the right side of the row to make the table display complete. For each row, the number (count) of blank cells added on the right is equal to the number of cells in the row where the components with permissions are invisible and the cells merged by the components are not fixed in place. Specifically, for each row, the initial value of count is set to 0, and a for loop is used to traverse each column. If there is an invisible component in the cell of the column and the cell is not fixed in place according to the judgment of step S6, count+1; if the merge attribute of the cell is equal to true, use step S8 to find the cell (targetCell) where the component that merges this cell is located. When the permission of the component in targetCell is invisible and the targetCell is not fixed in place according to the judgment of S6, count+1; after traversing all the columns of the row, the number of blank cells that need to be added to the right side of the row is calculated. Use a for loop, loop count times, and display one each time. <td rowspan=”1”colspan=”1”> , count cells are added to the right side of the row. Step S10: Improve the for loop in step S3, no longer traverse all the rows in the table, but filter out the rows with visible components, loop through these rows, and display them. Those rows that hide all components will no longer be displayed, so as to achieve the effect of moving the lower rows up. Specifically, filtering out the rows to be displayed includes: using a for loop to traverse each row of the table, and for each row, looking for a column in the row that meets one of the following two conditions: ① The merge attribute of the cell in the column is equal to false, and the permission of the component in the cell is visible; ② When the merge attribute of the cell in the column is true, find the targetCell cell where the component that merges the cell is located according to step S8, and the permission of the component in the targetCell is visible. If there is a column in the row that meets one of the two conditions, the row is displayed. Embodiment 2 An embodiment of the present disclosure provides a system for filling blanks in components on the right and below after hiding components in a dynamic table, including: an initialization module for initializing the dynamic table, adding a hidden variable for identifying component permissions to each component in the dynamic table; a traversal module for traversing the rows of the dynamic table using a for loop, and for each row, traversing each column using a for loop to display cells fixed at the original position and components in the cells; for each row, calculating the number of blank cells filled on the right, and continuing to display the same number of empty cells as the number of blank cells filled on the right in the row; a display module for changing the traversal mode of the for loop, no longer traversing all rows in the dynamic table, but filtering out rows with visible components, traversing the rows of visible components in a loop and displaying them; a rendering module for rendering the dynamic table using various tags. The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in the process, process, or multiple processes and / or box, box, or multiple boxes. These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operating steps are performed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in the process, process, or multiple processes and / or box, box, or multiple boxes.Although the above describes the specific implementation methods of the present disclosure in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present disclosure. Technical personnel in the relevant field should understand that on the basis of the technical solution of the present disclosure, various modifications or variations that can be made by those skilled in the art without creative work are still within the scope of protection of the present disclosure.

Claims

1. A method for moving and filling the right and lower components after hiding components in a dynamic table, characterized in that: include: Initialize the dynamic table and add a hidden variable for identifying component permissions to each component in the dynamic table; Use a for loop to traverse the rows of the dynamic table. For each row, use a for loop to traverse each column to display the cells fixed in the original position. For each row, calculate the number of blank cells added to the right, and continue to display the same number of empty cells and components in the cells as the number of blank cells added to the right in the row; The traversal mode of the for loop is changed. Instead of traversing all rows in the dynamic table, the rows with visible components are screened out, the rows of visible components are traversed in a loop and displayed, and the dynamic table is rendered using various tags.

2. The method for moving and filling the gaps on the right and below the hidden components of a dynamic table as claimed in claim 1, characterized in that: Initialize the dynamic table and generate the data structure of the dynamic table through the form designer. The data structure of the dynamic table is to nest columns in rows, nest cells in columns, and nest components in cells. Each cell has rowspan and colspan attributes to record the situation of merged cells. Rowspan records the number of merged rows, and colspan records the number of merged columns.

3. The method for moving and filling the gaps on the right and below the hidden components of a dynamic table as claimed in claim 1, characterized in that: For each component in the dynamic table, add a hidden variable to identify the component permissions. When hidden is equal to false, the permissions are visible; when hidden is equal to true, the permissions are invisible.

4. The method for moving and filling the gaps on the right and below the hidden components of a dynamic table as claimed in claim 1, characterized in that: Using HTML Filter out the rows to be displayed, including: using a for loop to traverse each row of the table, and for each row, find a column in the row that meets one of the two conditions: ① the merge attribute of the cell in the column is equal to false, and the permission of the component in the cell is visible; ② when the merge attribute of the cell in the column is true, find the cell targetCell where the component that merges the cell is located, and the permission of the component in the targetCell is visible. If there is a column in the row that meets one of the two conditions, then display the row. include: The initialization module is used to initialize the dynamic table and add a hidden variable for identifying the component permissions to each component in the dynamic table; The traversal module is used to use a for loop to traverse the rows of the dynamic table. For each row, a for loop is used to traverse each column to display the cells and components in the cells fixed at the original position. For each row, calculate the number of blank cells filled on the right, and continue to display the same number of empty cells in the row as the number of blank cells filled on the right; The display module is used to change the traversal mode of the for loop. Instead of traversing all rows in the dynamic table, the rows with visible components are selected, and the rows with visible components are traversed and displayed in a loop. The rendering module is used to render the dynamic table using various tags. Tags render dynamic tables, The tag renders the body of the table. Tags render dynamic table rows, Tags and set rowspan and colspan attributes to render dynamic table cells.

5. The method for moving and filling the gaps on the right and below the hidden components of a dynamic table as claimed in claim 1, characterized in that: For each row, use a for loop to traverse the columns and display the cells fixed in the original position. The cells fixed in the original position include: (1) the cells where the components with visible permissions are located and the cells merged with them; (2) the components with invisible permissions, but the space occupied by the right component is larger than that of the invisible component, and the right component cannot be moved, and the cells occupied by the invisible component and the cells merged with them; specifically, use a for loop to traverse each column and determine whether the merge attribute of the cells in the column is false or true.

6. The method for moving and filling the gaps on the right and below the hidden components of a dynamic table as claimed in claim 5, characterized in that: There are three cases when the merge property of a cell in a column is false: (1) there is no component in the cell; (2) there is a component in the cell and the permission of the component is visible; (3) there is a component in the cell and the permission of the component is invisible.

7. The method for moving and filling the gaps on the right and below the hidden components of a dynamic table as claimed in claim 6, characterized in that: When there is a component in the cell and the component permission is invisible, to determine whether the cell is fixed at the original position, it is necessary to determine whether the cell fixed at the original position is the source cell, including: finding the first cell without a component on the right side of the source cell, or the cell where the first component on the right side with visible permission is located, that is, the target cell, according to the row number and column number of the source cell and the table data; if the merge attribute of the target cell is true, the source cell is fixed at the original position; if the merge attribute of the target cell is false, and its rowspan is greater than the rowspan of the source cell, the source cell is fixed at the original position, otherwise, the source cell is not fixed at the original position.

8. The method for moving and filling the gaps on the right and below the hidden components of a dynamic table as claimed in claim 1, characterized in that: For each row, the initial value of count is set to 0, and a for loop is used to traverse each column. If there is an invisible component in the cell of the column and it is determined that the cell is not fixed in the original position, count+1; if the merge attribute of the cell is equal to true, find the cell targetCell where the component of the merged cell is located. When the permission of the component in the targetCell is invisible and it is determined that the targetCell is not fixed in the original position, count+1; after traversing all the columns of the row, calculate the number of blank cells that need to be added to the right side of the row, use a for loop, loop count times, and display one each time <td rowspan=”1”colspan=”1”> , then count cells are added to the right side of the row.

9. The method for filling the gaps on the right side and below the hidden components of a dynamic table as claimed in claim 1, characterized in that:

10. The system for filling the gaps on the right side and below the hidden components of a dynamic table, characterized in that: