Method and device for freezing data in table view, and electronic device
By copying and sticking the target row or column data in the table view without code application, convenient comparison of long-distance fields in the table view is achieved, the problem of inefficient freezing function in the existing technology is solved, and the user's data processing efficiency is improved and experience.
Patent Information
- Application Number
- CN202210048952.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-17
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2042-01-17
AI Technical Summary
In the existing table view of no-code application, it is difficult for users to compare long-distance fields with front and back fields without adjusting the table structure, and the existing freezing function is inefficient.
By determining the reference fields in the table view, copying and sticking the target row or column data, freezing it in the view, and scrolling it synchronously with other data for convenient comparison.
It improves the user's data processing efficiency and user experience in tables, and avoids the trouble of frequent vertical or horizontal scrolling of users to view and compare data.
Smart Images

Figure CN114417801B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of table processing, and in particular to a method and device for freezing data in a table view, an electronic device, and a computer-readable storage medium. Background Art
[0002] Code-free applications use forms as the entry point, connect forms with processes, and use code-free or low-code development platforms to enable business personnel to quickly build an application platform that meets the personalized needs of the enterprise by dragging and dropping. It can reduce the cost of business application development, quickly deploy to meet the agility needs of the organization, help enterprises achieve business needs for improving efficiency and reducing costs, and achieve efficient management of internal team collaboration.
[0003] In existing codeless applications, the table view is the main place for users to view data. In existing codeless application table views, if there are too many fields and a large number of fields are not displayed on the first page, and the user wants to compare the previous fields with the following fields, the method usually adopted is to freeze rows 1 to n, that is, to freeze from row 1 to row n, where n is a positive integer greater than 1. For example, to freeze rows 1 to 5, rows 1 to 5 are frozen starting from row 1. When the table is scrolled vertically, the data of rows 1 to 5 is compared with the data of the following fields, especially the data of the fields beyond the first screen. However, if the first screen can only display the data of 10 rows of fields, and if the user wants to compare the data of the field of row 15 with the data of the previous and following fields at the same time, the current freezing function cannot be realized and needs to be completed by adjusting the table structure, such as hiding or deleting certain columns. It can be seen that adjusting the table to achieve the function of data comparison is very troublesome and inefficient. Therefore, it is urgent to solve this technical problem. Summary of the invention
[0004] In view of the above problems, the present application is proposed to provide a method and device for freezing data in a table view, an electronic device and a computer-readable storage medium that overcome the above problems or at least partially solve the above problems. The technical solution is as follows:
[0005] In a first aspect, a method for freezing data in a table view is provided, comprising:
[0006] Determine the row or column where the reference field to be frozen is located in the table view;
[0007] In the case of detecting a freeze instruction for target row data or target column data, determining in the table view a target frozen row to which the target row data is to be frozen, or a target frozen column to which the target column data is to be frozen, wherein the target row data is data in the row where the reference field is located, and the target column data is data in the column where the reference field is located;
[0008] The target row data is copied to the target frozen row, and the target frozen row with the target row data copied thereto is frozen in the table view through a sticky layout; alternatively, the target column data is copied to the target frozen column, and the target frozen column with the target column data copied thereto is frozen in the table view through a sticky layout.
[0009] In a possible implementation, determining the row or column where the reference field to be frozen in the table view is located includes:
[0010] Receive the row or column of the reference field to be frozen selected in the table view; or
[0011] The historical table operation information is obtained, and the row or column where the reference field to be frozen is located is determined according to the historical table operation information.
[0012] In a possible implementation, after determining the row or column where the reference field to be frozen is located according to the historical table operation information, the method further includes:
[0013] If the number of rows where the reference fields to be frozen are determined to be multiple, determining the reference weight value of each row where the reference fields to be frozen are located according to the historical table operation information; adding a preset style to each row where the reference fields to be frozen are located and displaying it according to the reference weight value of each row where the reference fields to be frozen are located; or
[0014] If there are multiple columns where the reference fields to be frozen are determined, the reference weight value of each column where the reference fields to be frozen are determined according to the historical table operation information; and a preset style is added to and displayed for each column where the reference fields to be frozen according to the reference weight value of each column where the reference fields to be frozen are located.
[0015] In a possible implementation, when a freeze instruction for target row data or target column data is detected, determining in the table view a target frozen row to freeze the target row data, or a target frozen column to freeze the target column data, includes:
[0016] When it is detected that a button indicating freezing of target row data or target column data is triggered, the target frozen row to which the target row data is frozen, or the target frozen column to which the target column data is frozen, is determined in the table view according to the freezing information corresponding to the triggered button, wherein the freezing information includes indication information of the target frozen row to which the target row data is frozen, or the target frozen column to which the target column data is frozen.
[0017] In a possible implementation, determining, in the table view, a target frozen row to freeze the target row data, or a target frozen column to freeze the target column data, includes:
[0018] Determine a target field related to the reference field in the table view; use the row where the target field is located as the target frozen row, or use the column where the target field is located as the target frozen column; or
[0019] A preset row or a preset column in the table view is selected, and the selected preset row is used as the target frozen row, or the selected preset column is used as the target frozen column.
[0020] In a possible implementation, copying the target row data to the target frozen row, and freezing the target frozen row to which the target row data is copied in the table view by using a sticky layout, includes:
[0021] Copying the target row data to the target frozen row, and sequentially moving the original data of the target frozen row so that the original data avoids the target row data;
[0022] Setting the position attribute in the cell style of the target frozen row to a sticky attribute, and setting the row to which the target frozen row is adhered in the table view, so as to freeze the target frozen row having the target row data copied thereto in the table view;
[0023] The step of copying the target column data to the target frozen column, and freezing the target frozen column to which the target column data is copied in the table view by means of a sticky layout, comprises:
[0024] Copying the target column data to the target frozen column, and sequentially moving the original data of the target frozen column so that the original data avoids the target column data;
[0025] The position property in the cell style of the target frozen column is set to a sticky property, and the column to which the target frozen column is adhered in the table view is set, so as to freeze the target frozen column having the target column data copied thereto in the table view.
[0026] In a possible implementation, after the target column data is copied to the target frozen column and the target frozen column to which the target column data is copied is frozen in the table view through a sticky layout, the method further includes:
[0027] When a horizontal sliding event for the table view is detected, the target column data is fixed to the target frozen column, and data of other unfixed columns slide horizontally based on the horizontal sliding event;
[0028] When a vertical sliding event for the table view is detected, the target column data is vertically slid based on the vertical sliding event.
[0029] In a possible implementation, after the target row data is copied to the target frozen row, and the target frozen row to which the target row data is copied is frozen in the table view through a sticky layout, the method further includes:
[0030] When a horizontal sliding event for the table view is detected, the target row data slides horizontally based on the horizontal sliding event;
[0031] When a vertical sliding event for the table view is detected, the target row data is fixed to the target frozen row, and data of other unfixed rows slide vertically based on the vertical sliding event.
[0032] In a second aspect, a device for freezing data in a table view is provided, comprising:
[0033] A first determination module is used to determine the row or column where the reference field to be frozen is located in the table view;
[0034] A second determination module is used to determine, in the table view, a target frozen row to which the target row data is to be frozen, or a target frozen column to which the target column data is to be frozen, when a freezing instruction for target row data or target column data is detected, wherein the target row data is data of the row where the reference field is located, and the target column data is data of the column where the reference field is located;
[0035] A freezing module is used to copy the target row data to the target frozen row, and freeze the target frozen row with the target row data copied to the table view through a sticky layout, or to copy the target column data to the target frozen column, and freeze the target frozen column with the target column data copied to the table view through a sticky layout.
[0036] In a possible implementation manner, the first determining module is further configured to:
[0037] Receive the row or column of the reference field to be frozen selected in the table view; or
[0038] The historical table operation information is obtained, and the row or column where the reference field to be frozen is located is determined according to the historical table operation information.
[0039] In a possible implementation manner, the first determining module is further configured to:
[0040] After determining the row or column where the reference field to be frozen is located according to the historical table operation information, if the number of rows where the reference field to be frozen is determined to be multiple, determining the reference weight value of each row where the reference field to be frozen is located according to the historical table operation information; adding a preset style to each row where the reference field to be frozen is located and displaying it according to the reference weight value of each row where the reference field to be frozen is located; or
[0041] If there are multiple columns where the reference fields to be frozen are determined, the reference weight value of each column where the reference fields to be frozen are determined according to the historical table operation information; and a preset style is added to and displayed for each column where the reference fields to be frozen according to the reference weight value of each column where the reference fields to be frozen are located.
[0042] In a possible implementation manner, the second determining module is further configured to:
[0043] When it is detected that a button indicating freezing of target row data or target column data is triggered, the target frozen row to which the target row data is frozen, or the target frozen column to which the target column data is frozen, is determined in the table view according to the freezing information corresponding to the triggered button, wherein the freezing information includes indication information of the target frozen row to which the target row data is frozen, or the target frozen column to which the target column data is frozen.
[0044] In a possible implementation manner, the second determining module is further configured to:
[0045] Determine a target field related to the reference field in the table view; use the row where the target field is located as the target frozen row, or use the column where the target field is located as the target frozen column; or
[0046] A preset row or a preset column in the table view is selected, and the selected preset row is used as the target frozen row, or the selected preset column is used as the target frozen column.
[0047] In a possible implementation, the freezing module is further configured to:
[0048] Copying the target row data to the target frozen row, and sequentially moving the original data of the target frozen row so that the original data avoids the target row data;
[0049] The position attribute in the cell style of the target frozen row is set to a sticky attribute, and the row to which the target frozen row is adhered in the table view is set, so as to freeze the target frozen row having the target row data copied thereto in the table view.
[0050] In a possible implementation, the freezing module is further configured to:
[0051] Copying the target column data to the target frozen column, and sequentially moving the original data of the target frozen column so that the original data avoids the target column data;
[0052] The position property in the cell style of the target frozen column is set to a sticky property, and the column to which the target frozen column is adhered in the table view is set, so as to freeze the target frozen column having the target column data copied thereto in the table view.
[0053] In a possible implementation, the device also includes a first sliding module, which is used for, after the freezing module copies the target column data to the target frozen column, and freezes the target frozen column with the target column data copied to the table view through a sticky layout, when a horizontal sliding event for the table view is detected, the target column data is fixed in the target frozen column, and the data of other unfixed columns slide horizontally based on the horizontal sliding event; when a vertical sliding event for the table view is detected, the target column data slides vertically based on the vertical sliding event.
[0054] In a possible implementation, the device also includes a second sliding module, which is used for, after the freezing module copies the target row data to the target frozen row, and freezes the target frozen row with the target row data copied to the table view through a sticky layout, when a horizontal sliding event for the table view is detected, the target row data slides horizontally based on the horizontal sliding event; when a vertical sliding event for the table view is detected, the target row data is fixed to the target frozen row, and the data of other unfixed rows slide vertically based on the vertical sliding event.
[0055] According to a third aspect, an electronic device is provided, comprising a processor and a memory, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any of the above methods for freezing data in a table view.
[0056] According to a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program is configured to execute any of the above methods for freezing data in a table view when running.
[0057] By means of the above-mentioned technical scheme, the method and device for freezing data in a table view, the electronic device and the computer-readable storage medium provided in the embodiments of the present application can freeze the target frozen row with the data of the row where the reference field is located in the table view, so as to realize the convenient comparison between the data of the row where the reference field is located and the data of other rows, or freeze the target frozen column with the data of the column where the reference field is located in the table view, so as to realize the convenient comparison between the data of the column where the reference field is located and the data of other columns, thereby avoiding the problem that the user scrolls the data bar vertically up and down or scrolls the data bar horizontally left and right to view and compare the data, thereby effectively improving the data processing efficiency and usage experience of the user in the process of using the table. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.
[0059] Figure 1 A flowchart showing a method for freezing data in a table view according to an embodiment of the present application is shown;
[0060] Figure 2 A flowchart showing a method for freezing data in a table view according to another embodiment of the present application is shown;
[0061] Figure 3 A table view of an embodiment of the present application is shown;
[0062] Figure 4 It shows that a button indicating freezing in a drop-down list in a column header of a column where a reference field is located in an embodiment of the present application is triggered;
[0063] Figure 5 It shows that the data in the column where the reference field is located in the embodiment of the present application is frozen to the first column;
[0064] Figure 6 The column where the reference field to be frozen is located in another embodiment of the present application is shown;
[0065] Figure 7 Another embodiment of the present application shows that the data in the column where the reference field is located is copied to the first column;
[0066] Figure 8 A working principle diagram of the sticky layout of an embodiment of the present application is shown;
[0067] Fig. 9 A structural diagram of a device for freezing data in a table view in an embodiment of the present application is shown;
[0068] Fig.10 A structural diagram of a device for freezing data in a table view according to another embodiment of the present application is shown. DETAILED DESCRIPTION
[0069] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.
[0070] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that such use is interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the term "including" and its variants are to be interpreted as open-ended terms meaning "including but not limited to".
[0071] The present application embodiment provides a method for freezing data in a table view, which can be applied to electronic devices such as servers, personal computers, smart phones, and tablet computers. Figure 1 As shown, the method for freezing data in the table view may include the following steps S101 to S103:
[0072] Step S101, determining the row or column where the reference field to be frozen is located in the table view;
[0073] Step S102, when a freezing instruction for target row data or target column data is detected, determining in a table view a target frozen row to which the target row data is frozen, or a target frozen column to which the target column data is frozen, wherein the target row data is data in a row where a reference field is located, and the target column data is data in a column where a reference field is located;
[0074] Step S103, copy the target row data to the target frozen row, and freeze the target frozen row with the target row data copied thereto in the table view through sticky layout, or copy the target column data to the target frozen column, and freeze the target frozen column with the target column data copied thereto in the table view through sticky layout.
[0075] A table is a means of organizing and collating data. It means drawing grids to construct rows and columns according to the required data content to fill in data, so as to facilitate viewing and statistical data. Table view displays the table to the user in the form of a view, and the user can process the data in the table through the table view.
[0076] A field can be a feature or attribute of an object, where an object can be a thing, a person, etc. For example, for a student object, fields such as name, age, class, hobbies, etc. are the characteristics of the student; for a company object, fields such as name, enterprise type, unified social credit code, etc. are the attributes of the company. It should be noted that the examples here are only illustrative and do not limit the embodiments of the present application.
[0077] Fields and field data can be filled in the rows of the table to record information about the characteristics or attributes of the object, or fields and field data can be filled in the columns of the table to record information about the characteristics or attributes of the object.
[0078] The embodiments of the present application can freeze the target frozen row where the data of the row where the reference field is located is copied in the table view, so as to realize the convenient comparison between the data of the row where the reference field is located and the data of other rows, or freeze the target frozen column where the data of the column where the reference field is located is copied in the table view, so as to realize the convenient comparison between the data of the column where the reference field is located and the data of other columns, thereby avoiding the problem that the user scrolls the data bar vertically up and down or scrolls the data bar horizontally left and right to view and compare the data, and effectively improves the data processing efficiency and the user experience in the process of using the table.
[0079] A possible implementation method is provided in an embodiment of the present application. In the above step S101, determining the row or column where the reference field to be frozen in the table view is located may specifically include the following steps A1 or A2:
[0080] Step A1, receiving the row or column where the reference field to be frozen is located, selected in the table view.
[0081] In this step, the row or column where the reference field to be frozen is located can be actively selected according to the actual needs of the user.
[0082] Step A2, obtaining historical table operation information, and determining the row or column where the reference field to be frozen is located according to the historical table operation information.
[0083] In this step, when determining the row where the reference field to be frozen is located based on the historical table operation information, the row fixed in the user's history can be determined as the row that needs to be frozen this time, that is, the row where the reference field to be frozen is located, based on the historical table operation information; or, the row with the most fixed operations can be determined as the row that needs to be frozen this time; or, the row to be frozen can be determined based on artificial intelligence, for example, the table imported by the user is used as a model input, and the model is used to predict the row in the table that is most likely to be fixed by the user. The training samples of the model are the sample table of the user's historical operations and the labeled data, that is, which rows in the labeled sample table are the rows fixed by the user's history.
[0084] When determining the column where the reference field to be frozen is located based on the historical table operation information, the column that the user has historically fixed can be determined as the column that needs to be frozen and fixed this time, that is, the column where the reference field to be frozen is located; or, the column with the most fixed operations can be determined as the column that needs to be frozen and fixed this time; or, the column to be frozen can be determined based on artificial intelligence, for example, the table imported by the user is used as the model input, and the model is used to predict the column in the table that is most likely to be fixed by the user. The training samples of the model are the sample table of the user's historical operations and the labeled data, that is, which columns in the labeled sample table are the columns fixed by the user's history.
[0085] It can be seen that this embodiment can combine the historical table operation information of the user to recommend the row or column where the reference field to be frozen is located, thereby improving the freezing efficiency.
[0086] The present application provides a possible implementation method. After the above step A2 determines the row or column where the reference field to be frozen is located according to the historical table operation information, the following step B1 may be included:
[0087] Step B1, add a preset style to the row or column where the reference field to be frozen is located and display it. The preset style here can be highlighting, underlining, bolding, changing the font, etc.
[0088] Since the row or column where the reference field is recommended is based on historical table operation information, the user may not know it in advance. By adding a preset style to the row or column where the reference field to be frozen is located and displaying it to the user, the user does not need to check the row or column to be frozen one by one in the table. The row or column where the reference field to be frozen is located can be quickly determined according to the preset style prompts in the table view, thereby improving the efficiency of freezing.
[0089] In an embodiment of the present application, a possible implementation method is provided. If the number of rows where the reference fields to be frozen are determined to be located is multiple, step B1 adds a preset style to the rows where the reference fields to be frozen are determined to be located and displays them. Specifically, step B1-1 may include:
[0090] Step B1-1, determining the reference weight value of each row where the reference field to be frozen is located according to the historical table operation information; adding a preset style to each row where the reference field to be frozen is located and displaying it according to the reference weight value of each row where the reference field to be frozen is located.
[0091] In this step, in one example, multiple historically fixed rows can be determined based on the historical table operation information and the number of fixed operations of each row in the multiple rows can be counted, and each row in the multiple rows can be used as the row where each reference field to be frozen is located, and then the reference weight value of each row where each reference field to be frozen is located can be determined based on the number of fixed operations of each row. For example, the more the number of fixed operations, the greater the reference weight value. It should be noted that the examples here are only illustrative and do not limit this embodiment.
[0092] Taking the preset style of highlight as an example, the rows where the reference fields to be frozen are located can be displayed according to the degree of highlighting significance based on the reference weight values of the rows where the reference fields to be frozen are located. For example, the larger the reference weight value, the higher the degree of highlighting significance. Assuming that the rows where the reference fields to be frozen are determined to be rows 1, 2, 3, and 4, and their reference weight values are 0.6, 0.8, 0.3, and 0.5, respectively, the degrees of highlighting significance of the rows where the reference fields to be frozen are determined to be highlight 2, highlight 1, highlight 4, and highlight 3, respectively, and then the rows where the reference fields to be frozen are displayed according to the degree of highlighting significance. In this embodiment, when the number of rows where the reference fields to be frozen are determined to be multiple, a preset style can be added to the rows where the reference fields to be frozen are located according to the reference weight values of the rows where the reference fields to be frozen are located, and the rows can be displayed, which can facilitate user viewing and improve the efficiency of freezing.
[0093] In an embodiment of the present application, a possible implementation method is provided. If the number of columns where the reference fields to be frozen are determined to be located is multiple, step B1 adds a preset style to the columns where the reference fields to be frozen are determined to be located and displays them. Specifically, step B1-2 may be included:
[0094] Step B1-2, determining the reference weight value of each column where the reference field to be frozen is located according to the historical table operation information; adding a preset style to the column where the reference field to be frozen is located and displaying it according to the reference weight value of each column where the reference field to be frozen is located.
[0095] In this step, in one example, multiple columns that are historically fixed can be determined based on the historical table operation information, and the number of fixed operations on each of the multiple columns can be counted, and each of the multiple columns can be used as a column where each reference field to be frozen is located, and then the reference weight value of each column where each reference field to be frozen is located can be determined based on the number of fixed operations on each column. For example, the more the number of fixed operations, the greater the reference weight value. It should be noted that the examples here are only illustrative and do not limit this embodiment.
[0096] Taking the preset style of underline as an example, different numbers of underlines can be added to and displayed in the columns where the reference fields to be frozen are located according to the reference weight values of the columns where the reference fields to be frozen are located. For example, the larger the reference weight value, the more underlines there are. Assuming that the columns where the reference fields to be frozen are determined to be columns 1, 2, 3, and 4, and their reference weight values are 0.5, 0.6, 0.3, and 0.8, respectively, the underlines in the columns where the reference fields to be frozen are determined to be 2 underlines, 3 underlines, 1 underline, and 4 underlines, respectively, and then the corresponding number of underlines are added to and displayed in the columns where the reference fields to be frozen are located. In this embodiment, when the number of columns where the reference fields to be frozen is determined to be multiple, a preset style can be added to and displayed in the columns where the reference fields to be frozen are located according to the reference weight values of the columns where the reference fields to be frozen are located, which can facilitate user viewing and improve the efficiency of freezing.
[0097] A possible implementation method is provided in an embodiment of the present application. In the above step S102, when a freeze instruction for the target row data is detected, the target frozen row to which the target row data is frozen is determined in the table view. Specifically, when it is detected that a button indicating freezing for the target row data is triggered, the target frozen row to which the target row data is frozen is determined in the table view according to the freezing information corresponding to the triggered button, wherein the freezing information may include indication information of the target frozen row to which the target row data is frozen.
[0098] For example, it may be that a button indicating freeze is triggered in a drop-down list of a row header corresponding to the target row data, or a button indicating freeze is triggered in a drop-down list of a click, double-click or right-click of the mouse on the target row data, or a button indicating freeze is triggered in an operation bar or toolbar corresponding to the target row data, etc. This embodiment does not impose any restrictions on this.
[0099] It is understandable that the freezing information can be preset according to actual needs, such as freezing information can be freezing to the first row or freezing to the second row, or freezing to this row, that is, freezing to the original position of the row where the reference field is located, etc., and the embodiments of the present application do not limit this. Here, freezing to the first row means freezing the target row data to the first row, freezing to the second row means freezing the target row data to the second row, and freezing to this row means freezing the target row data to the original position of the row where the reference field is located. It can be seen that the embodiments of the present application can initiate a freezing instruction in a variety of ways, and determine the target frozen row to freeze the target row data, that is, the data of the row where the reference field is located, so that the freezing process of the table is more flexible and convenient.
[0100] A possible implementation method is provided in an embodiment of the present application. In the above step S102, when a freeze instruction for the target column data is detected, the target frozen column to which the target column data is frozen is determined in the table view. Specifically, when it is detected that a button indicating freezing the target column data is triggered, the target frozen column to which the target column data is frozen is determined in the table view according to the freezing information corresponding to the triggered button, wherein the freezing information may include indication information of the target frozen column to which the target column data is frozen.
[0101] For example, a button indicating freeze in a drop-down list of a column header corresponding to the target column data may be triggered when it is detected that the target column data is clicked, double-clicked, or the right button of the mouse is clicked when it is detected that the target column data is clicked, or a button indicating freeze in an operation bar or toolbar corresponding to the target column data may be triggered when it is detected that the target column data is clicked, etc. This embodiment does not limit this.
[0102] It is understandable that the freezing information here can be preset according to actual needs, such as freezing information can be frozen to the first column or frozen to the second column, or frozen to this column, that is, frozen to the original position of the column where the reference field is located, etc., and the embodiments of the present application do not limit this. Here, freezing to the first column means freezing the target column data to the first column, freezing to the second column means freezing the target column data to the second column, and freezing to this column means freezing the target column data to the original position of the column where the reference field is located. It can be seen that the embodiments of the present application can initiate a freezing instruction in a variety of ways, and determine the target frozen column to which the target column data, i.e., the data in the column where the reference field is located, is frozen, and the freezing process of the table is more flexible and convenient.
[0103] The present application provides a possible implementation method. The above step S102 determines the target frozen row to which the target row data is frozen, or the target frozen column to which the target column data is frozen in the table view, which may specifically include the following steps C1:
[0104] Step C1, determining a target field related to a reference field in a table view; using the row where the target field is located as a target frozen row, or using the column where the target field is located as a target frozen column;
[0105] For example, in the table view of academic management, the fields include "Teacher", "Teaching Subject", "Grade", "Class", "Course Name", "Class Week", "Class Date", "Class Time", etc. If the row where the reference field to be frozen is located is "Class Time", it can be determined that the target field related to the reference field "Class Time" is "End of get out of class Time", then the row where "End of get out of class Time" is located can be used as the target frozen row.
[0106] If the column where the reference field to be frozen is located is "class time", it can be determined that the target field related to the reference field "class time" is "end of get out of class time", and the column where "end of get out of class time" is located can be used as the target frozen column. It should be noted that the examples given here are only illustrative and do not limit the embodiments of the present application. The embodiments of the present application determine the target field related to the reference field in the table view, and use the row where the target field is located as the target frozen row, or use the column where the target field is located as the target frozen column, which can provide more abundant target frozen rows or target frozen columns, provide users with more choices, and thus improve the efficiency of freezing.
[0107] The present application provides a possible implementation method. The above step S102 determines the target frozen row to which the target row data is frozen, or the target frozen column to which the target column data is frozen in the table view, which may specifically include the following steps C2:
[0108] Step C2, selecting a preset row or a preset column in the table view, and using the selected preset row as a target frozen row, or using the selected preset column as a target frozen column.
[0109] It can be understood that the preset row here can be the first row or other rows, and the preset column can be the first column or other columns. It can be set according to actual needs, and this embodiment does not limit this.
[0110] As mentioned above, currently in most table views, fixed rows only freeze rows 1 to n, and have not yet achieved freezing a row to a target frozen row of the table, such as the first row or the second row. There are many implementation schemes for freezing to a row, such as a table splitting scheme, splitting the part to be frozen and the part that does not need to be frozen into two elements, so that the unfrozen part can be controlled by itself, and only the unfrozen elements are scrolled when the page is scrolled to achieve the freezing effect. However, the embodiment of the present application can copy the data in the row to be frozen to the target frozen row, so that in the process of implementing the scrolling of the entire table, the copied row still maintains the style of the target frozen row. Specifically, in the above step S103, the target row data is copied to the target frozen row, and the target frozen row with the copied target row data is frozen in the table view through the sticky layout, which can include the following steps D1 to D2:
[0111] Step D1, copying the target row data to the target frozen row, and sequentially moving the original data of the target frozen row so that the original data avoids the target row data;
[0112] Here, the sequential movement can be to move the original data of the target frozen row from top to bottom or from bottom to top according to the arrangement order of the rows in the table, and the number of rows moved can be any integer, such as moving one row downward. In this way, the original data of the target frozen row can avoid the target row data, so that the target row data is completely presented.
[0113] For example, data a, b, c, d, and e are located in rows A, B, C, D, and E respectively. When row C is clicked to freeze to the first row, the data in row C is copied to get c1, and the copied data c1 is placed in the first row of the table data. At this time, the table data becomes [c1, a, b, c, d, e]. You can see that the target row data c1 is copied to the first row as the target frozen row, and the original data a in the first row is moved sequentially so that the original data a avoids the target row data c1.
[0114] For another example, data a, b, c, d, and e are located in rows A, B, C, D, and E respectively. When row C is clicked to freeze to the second row, the data in row C is copied to get c1, and the copied data c1 is placed in the second row of the table data. At this time, the table data becomes [a, c1, b, c, d, e]. You can see that the target row data c1 is copied to the second row as the target frozen row, and the original data b in the second row is moved sequentially so that the original data b avoids the target row data c1.
[0115] Step D2, setting the position attribute in the cell style of the target frozen row to the sticky attribute, and setting the row to which the target frozen row is adhered in the table view, so as to freeze the target frozen row with the target row data copied in the table view.
[0116] For example, there are three common methods for fixing an element in CSS (Cascading Style Sheets), specifically setting the position attribute to absolute (absolute positioning) attribute, fixed (mixed positioning) attribute or sticky (sticky positioning) attribute. The table used in the embodiment of the present application is a Table element, which not only needs to support the fixation of a row when scrolling up and down, but also needs to ensure that the fixed row can scroll normally when scrolling left and right. If absolute and fixed are used, there will be a problem that the elements of the fixed row will not follow the scrolling when sliding left and right. Therefore, the sticky solution is adopted here, that is, the position attribute in the cell format of the target frozen row is set to the sticky attribute sticky.
[0117] The sticky layout in the embodiment of the present application utilizes this feature of CSS. At this time, no matter how the scroll bar slides, the data in the row where the reference field is located can be close to the target frozen row, and finally the freezing effect can be achieved. The rows that are not fixed can be viewed by sliding the scroll bar. When setting the sticky layout of an element, the position where the element needs to be adhered in the table view must also be set. In CSS, the top attribute specifies the offset of the element from the top. Therefore, the top value can be set according to the row position where the target frozen row is adhered in the table view. For example, if the target frozen row is the first row, the top value can be set to 0; if the target frozen row is the second row, the top value can be set to 1. It should be noted that the examples given here are only illustrative and do not limit the embodiments of the present application.
[0118] Currently, in most table views, fixed columns only realize freezing of the 1st column to the nth column, that is, freezing from the 1st column to the nth column, and have not yet realized freezing a certain column to the target frozen column of the table, such as the first column or the second column. There are many implementation schemes for freezing to a certain column, such as the scheme of splitting the table, splitting the part to be frozen and the part not to be frozen into two elements, so that the unfrozen part can be controlled by itself, and only the unfrozen elements are scrolled when the page is scrolled, so as to achieve the freezing effect. However, the embodiment of the present application can copy the data in the column to be frozen to the target frozen column, so that in the process of realizing the scrolling of the entire table, the copied column still maintains the style of the target frozen column. Specifically, in the above step S103, the target column data is copied to the target frozen column, and the target frozen column with the copied target column data is frozen in the table view through the sticky layout, which can include the following steps E1 to E2:
[0119] Step E1, copying the target column data to the target frozen column, and sequentially moving the original data of the target frozen column so that the original data avoids the target column data;
[0120] Here, the sequential movement can be to move the original data of the target frozen column from left to right or from right to left according to the arrangement order of the columns in the table, and the number of columns moved can be any integer, such as moving one column to the right. In this way, the original data of the target frozen column can avoid the target column data, so that the target column data is completely presented.
[0121] For example, data a, b, c, d, e, and f are located in columns A, B, C, D, E, and F respectively. When column E is clicked to freeze to the first column, the data in column E is copied to get e1, and the copied data e1 is placed in the first column of the table data. At this time, the table data becomes [e1, a, b, c, d, e, f]. You can see that the target column data e1 is copied to the first column of the target frozen column, and the original data a in the first column is moved sequentially so that the original data a avoids the target column data e1.
[0122] For another example, data a, b, c, d, e, and f are located in columns A, B, C, D, E, and F respectively. When column E is clicked to freeze to the second column, the data in column E is copied to get e1, and the copied data e1 is placed in the second column of the table data. At this time, the table data becomes [a, e1, b, c, d, e, f]. You can see that the target column data e1 is copied to the second column as the target frozen column, and the original data b in the second column is moved sequentially so that the original data b avoids the target column data e1.
[0123] Step E2, setting the position property in the cell style of the target frozen column to the sticky property, and setting the column to which the target frozen column is attached in the table view, so as to freeze the target frozen column with the target column data copied in the table view.
[0124] For example, there are three common methods for fixing an element in CSS, namely setting the position attribute to absolute, fixed or sticky. The table used in the embodiment of the present application is a Table element, which not only needs to support the fixation of a column when scrolling left and right, but also needs to ensure that the fixed column can scroll normally when scrolling up and down. If absolute and fixed are used, there will be a problem that the elements of the fixed column will not follow the scrolling when sliding up and down. Therefore, the sticky solution is adopted here, that is, the position attribute in the cell format of the target frozen column is set to the sticky attribute sticky.
[0125] The sticky layout in the embodiment of the present application utilizes this feature of CSS. At this time, no matter how the scroll bar slides, the data in the column where the reference field is located can be close to the target frozen column, and finally the freezing effect can be achieved. The columns that are not fixed can be viewed by sliding the scroll bar. When setting the sticky layout of an element, the position where the element needs to be adhered in the table view must be set at the same time. In CSS, the left attribute specifies the offset of the element from the left side. Therefore, the value of left can be set according to the column position where the target frozen column is adhered in the table view. For example, if the target frozen column is the first column, the value of left can be set to 0; if the target frozen column is the second column, the value of left can be set to 1. It should be noted that the examples listed here are only illustrative and do not limit the embodiments of the present application.
[0126] A possible implementation method is provided in an embodiment of the present application. After the target column data is copied to the target frozen column in the above step S103, and the target frozen column with the copied target column data is frozen in the table view through the sticky layout, when a horizontal sliding event for the table view is detected, the target column data can be fixed in the target frozen column, and the data of other unfixed columns can slide horizontally based on the horizontal sliding event; and when a vertical sliding event for the table view is detected, the target column data can slide vertically based on the vertical sliding event. It can be seen that in this embodiment, no matter how the scroll bar slides horizontally, the data in the column where the reference field is located can be close to the target frozen column, and finally the freezing effect can be achieved, and the columns that are not frozen and fixed can be viewed by sliding the scroll bar, and the fixed columns can scroll vertically normally when scrolling up and down vertically, which is convenient for users to process the table and view the table data.
[0127] A possible implementation method is provided in an embodiment of the present application. After the target row data is copied to the target frozen row in the above step S103 and the target frozen row with the copied target row data is frozen in the table view through the sticky layout, the target row data can slide horizontally based on the horizontal sliding event when a horizontal sliding event for the table view is detected; and when a vertical sliding event for the table view is detected, the target row data is fixed in the target frozen row, and the data of other unfixed rows slide vertically based on the vertical sliding event. It can be seen that in this embodiment, no matter how the scroll bar slides vertically, the data of the row where the reference field is located can be close to the target frozen row, and the freezing effect can be achieved in the end, and the rows that are not frozen and fixed can be viewed by sliding the scroll bar, and the fixed rows can scroll horizontally and left and right normally when scrolling horizontally, which is convenient for users to process the table and view the table data.
[0128] The above introduces Figure 1 In the illustrated embodiment, various implementation methods of each link are described. The method for freezing data in a table view will be further described below through a specific embodiment.
[0129] In a specific embodiment, taking freezing the data in the column where the reference field is located as an example, the target frozen column is the first column, and the data in the column where the reference field is located is frozen and fixed in the first column, which can conveniently compare the data in the column where the reference field is located with the data in other columns, effectively improving the data processing efficiency and user experience in the process of using the table. It should be noted that freezing the data in the row where the reference field is located is similar to the embodiment of freezing the data in the column where the reference field is located described below, and will not be described in detail.
[0130] Figure 2 A flowchart of a method for freezing data in a table view according to another embodiment of the present application is shown. Figure 2As shown, the method for freezing data in the table view may include the following steps S201 to S204.
[0131] Step S201, determining the column where the reference field to be frozen is located in the table view.
[0132] Take the code-free application of academic management as an example. Figure 3 As shown in the table view of the education management, the fields include "teacher", "subject", "grade", "class", "course name", "class week", "class date", "class time", etc. Find the data column that needs to be compared as the column where the reference field to be frozen is located, for example, "class time" is the data column that needs to be compared.
[0133] Step S202 , when a freezing instruction for target column data is detected, determining in the table view that the target column data is to be frozen to a target frozen column as the first column, wherein the target column data is data of the column where the reference field is located.
[0134] like Figure 4 As shown, the button "Freeze to First Column" indicating freezing in the drop-down list of the column header of the reference field column "Class Time" is triggered, and the target frozen column to which the data of the reference field column "Class Time" is frozen is determined to be the first column.
[0135] Step S203 , copying the target column data to the first column, and freezing the first column to which the target column data is copied in the table view through a sticky layout.
[0136] like Figure 5 As shown, the data of the "Class Time" column where the reference field is located is copied to the first column and frozen in the first column. The "Class Time" data will always be displayed in the first column. You can slide the slider horizontally and drag the subsequent data to compare with the data frozen in the first column.
[0137] When the above step S203 is implemented, the target column data can be copied to the first column, and the original data of the first column can be moved sequentially so that the original data avoids the target column data; then, the position attribute position in the cell format of the first column is set to the sticky attribute sticky, and the left value is set to 0 according to the column position of the first column to form a sticky layout, and the first column with the target column data copied is frozen in the table view.
[0138] For the convenience of description, define table data: tableData:[a,b,c,d,e,f]
[0139] Customize the style of table cells, such as Figure 6As shown, data a, b, c, d, e, and f are located in columns A, B, C, D, E, and F respectively. When column E is clicked to freeze to the first column, the data in this column is copied to obtain e1, and the copied data is placed at the first position of the table data. At this time, the table data becomes [e1, a, b, c, d, e, f]. When the page is rendered, the first column E1 of the table becomes the copied data, as shown in the figure. Figure 7 As shown, the cell style of the first column is set to position:sticky, left:0 to form a sticky layout. The sticky here can be used to fix elements. Its working principle is as follows Figure 8 shown.
[0140] exist Figure 8 In the example, the container represents the entire table, the solid black frame represents the home screen window, the shaded part is the sticky element, and the virtual frame is the element without sticky. When the container content slides to the left, the sticky element will not scroll with it, and the element without sticky will slide to the left. The sticky layout takes advantage of the CSS feature of fixing an element. At this time, no matter how the scroll bar slides, the column can stick to the leftmost side, and finally achieve the freezing effect, while the unfixed columns can be viewed by sliding the scroll bar. When setting the sticky layout of the element, you must also set the position where the element needs to stick. Left is 0, which means the left side of the container. Similarly, if you need to fix a row of elements to the top of the container, you can set top to 0.
[0141] To make it more visually friendly, by setting the color attribute of the right border of the cells in the fixed column, a vertical line of a custom color can be formed, which can quickly identify that the column has been frozen.
[0142] Step S204, when a horizontal sliding event for the table view is detected, the target column data is fixed in the first column, and the data of other unfixed columns slide horizontally based on the horizontal sliding event; and when a vertical sliding event for the table view is detected, the target column data slides vertically based on the vertical sliding event.
[0143] The embodiment of the present application can freeze the data in the column where the reference field is located in the first column, thereby achieving convenient comparison with the data in other columns, avoiding the problem of users scrolling back and forth horizontally on the data bar to view and compare data, and effectively improving the data processing efficiency and user experience of users when using the table.
[0144] It should be noted that, in practical applications, all possible implementation methods described above can be arbitrarily combined to form possible embodiments of the present application, which will not be described one by one here.
[0145] Based on the methods for freezing data in a table view provided in the above embodiments, and based on the same inventive concept, an embodiment of the present application further provides a device for freezing data in a table view.
[0146] Fig. 9 FIG. 4 shows a structure diagram of a freezing device for data in a table view in an embodiment of the present application. Fig. 9 As shown, the device for freezing data in the table view may include a first determining module 910 , a second determining module 920 and a freezing module 930 .
[0147] A first determining module 910 is used to determine the row or column where the reference field to be frozen is located in the table view;
[0148] A second determination module 920 is used to determine, in the table view, a target frozen row to freeze the target row data or a target frozen column to freeze the target column data, when a freeze instruction for the target row data or the target column data is detected, wherein the target row data is data of the row where the reference field is located, and the target column data is data of the column where the reference field is located;
[0149] The freezing module 930 is used to copy the target row data to the target frozen row, and freeze the target frozen row with the target row data copied in the table view through the sticky layout, or copy the target column data to the target frozen column, and freeze the target frozen column with the target column data copied in the table view through the sticky layout.
[0150] A possible implementation method is provided in the embodiments of the present application. Fig. 9 The first determination module 910 is also used for:
[0151] Receive the row or column of the reference field to be frozen selected in the table view; or
[0152] Obtain historical table operation information, and determine the row or column where the reference field to be frozen is located according to the historical table operation information.
[0153] A possible implementation method is provided in the embodiments of the present application. Fig. 9 The first determination module 910 is also used for:
[0154] After determining the row or column where the reference field to be frozen is located according to the historical table operation information, if the number of rows where the reference field to be frozen is determined to be multiple, determining the reference weight value of each row where the reference field to be frozen is located according to the historical table operation information; adding a preset style to each row where the reference field to be frozen is located and displaying it according to the reference weight value of each row where the reference field to be frozen is located; or
[0155] If there are multiple columns where reference fields to be frozen are determined, the reference weight value of each column where reference fields to be frozen are determined based on the historical table operation information; and a preset style is added to and displayed for each column where reference fields to be frozen based on the reference weight value of each column where reference fields to be frozen are located.
[0156] A possible implementation method is provided in the embodiments of the present application. Fig. 9 The second determination module 920 is also used for:
[0157] When it is detected that a button indicating freezing of target row data or target column data is triggered, the target frozen row to which the target row data is frozen, or the target frozen column to which the target column data is frozen, is determined in the table view according to the freezing information corresponding to the triggered button, wherein the freezing information includes indication information of the target frozen row to which the target row data is frozen, or the target frozen column to which the target column data is frozen.
[0158] A possible implementation method is provided in the embodiments of the present application. Fig. 9 The second determination module 920 is also used for:
[0159] Identify the target field in the table view that is related to the reference field; use the target field's row as the target frozen row, or use the target field's column as the target frozen column; or
[0160] Select a preset row or preset column in the table view to target the frozen rows or to target the frozen columns.
[0161] A possible implementation method is provided in the embodiments of the present application. Fig. 9 The illustrated freeze module 930 is also used to:
[0162] The target row data is copied to the target frozen row, and the original data of the target frozen row is moved sequentially so that the original data avoids the target row data;
[0163] Set the Position property in the cell style of the target frozen row to the Sticky property, and set the row to which the target frozen row is attached in the table view to freeze the target frozen row with the copied target row data in the table view.
[0164] A possible implementation method is provided in the embodiments of the present application. Fig. 9 The illustrated freeze module 930 is also used to:
[0165] Copy the target column data to the target frozen column, and sequentially move the original data of the target frozen column so that the original data avoids the target column data;
[0166] Set the Position property in the cell style of the target frozen column to Sticky, and set the column to which the target frozen column is attached in the table view to freeze the target frozen column with the copied target column data in the table view.
[0167] A possible implementation method is provided in the embodiment of the present application, such as Fig.10 As shown above Fig. 9 The displayed device may also include a first sliding module 1010, which is used to copy the target column data to the target frozen column after the freezing module 930 and freeze the target frozen column with the copied target column data in the table view through a sticky layout. When a horizontal sliding event for the table view is detected, the target column data is fixed in the target frozen column, and the data of other unfixed columns slide horizontally based on the horizontal sliding event; when a vertical sliding event for the table view is detected, the target column data slides vertically based on the vertical sliding event.
[0168] A possible implementation method is provided in the embodiment of the present application, such as Fig.10 As shown above Fig. 9 The displayed device may also include a second sliding module 1020, which is used to copy the target row data to the target frozen row after the freezing module 930 copies the target row data and freezes the target frozen row with the target row data copied in the table view through a sticky layout. When a horizontal sliding event for the table view is detected, the target row data slides horizontally based on the horizontal sliding event; when a vertical sliding event for the table view is detected, the target row data is fixed to the target frozen row, and the data of other unfixed rows slide vertically based on the vertical sliding event.
[0169] Based on the same inventive concept, an embodiment of the present application further provides an electronic device, including a processor and a memory, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the method for freezing data in a table view of any one of the above embodiments.
[0170] Based on the same inventive concept, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute a method for freezing data in a table view of any of the above embodiments when running.
[0171] Those skilled in the art can clearly understand that the specific working processes of the systems, devices, and modules described above can refer to the corresponding processes in the aforementioned method embodiments, and for the sake of brevity, they are not further described here.
[0172] Those skilled in the art can understand that the technical solution of the present application can be essentially or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, which includes a number of program instructions, so that an electronic device (such as a personal computer, a server, or a network device, etc.) executes all or part of the steps of the method described in each embodiment of the present application when running the program instructions. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0173] Alternatively, all or part of the steps of implementing the aforementioned method embodiments may be accomplished by hardware associated with program instructions (such as electronic devices such as personal computers, servers, or network devices), and the program instructions may be stored in a computer-readable storage medium. When the program instructions are executed by a processor of an electronic device, the electronic device executes all or part of the steps of the methods described in the embodiments of the present application.
[0174] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that within the spirit and principles of the present application, they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not deviate from the protection scope of the present application.
Claims
1. A method for freezing data in a table view, characterized in that: include: Determine the row or column where the reference field to be frozen is located in the table view; In the case of detecting a freeze instruction for target row data or target column data, determining in the table view a target frozen row to which the target row data is to be frozen, or a target frozen column to which the target column data is to be frozen, wherein the target row data is data in the row where the reference field is located, and the target column data is data in the column where the reference field is located; Copying the target row data to the target frozen row, and freezing the target frozen row with the target row data copied to the table view through sticky layout, including: copying the target row data to the target frozen row, and sequentially moving the original data of the target frozen row so that the original data avoids the target row data; setting the position attribute in the cell style of the target frozen row to a sticky attribute, and setting the row to which the target frozen row adheres in the table view, so as to freeze the target frozen row with the target row data copied to the table view; Alternatively, the target column data is copied to the target frozen column, and the target frozen column with the target column data copied thereto is frozen in the table view through a sticky layout, including: copying the target column data to the target frozen column, and sequentially moving the original data of the target frozen column so that the original data avoids the target column data; setting the position attribute in the cell style of the target frozen column to a sticky attribute, and setting the column to which the target frozen column adheres in the table view, so as to freeze the target frozen column with the target column data copied thereto in the table view.
2. The method for freezing data in a table view according to claim 1, characterized in that: The step of determining the row or column where the reference field to be frozen in the table view is located includes: Receive the row or column of the reference field to be frozen selected in the table view; or The historical table operation information is obtained, and the row or column where the reference field to be frozen is located is determined according to the historical table operation information.
3. The method for freezing data in a table view according to claim 2, characterized in that: After determining the row or column where the reference field to be frozen is located according to the historical table operation information, the method further includes: If the number of rows where the reference fields to be frozen are determined to be multiple, determining the reference weight value of each row where the reference fields to be frozen are located according to the historical table operation information; adding a preset style to each row where the reference fields to be frozen are located and displaying it according to the reference weight value of each row where the reference fields to be frozen are located; or If there are multiple columns where the reference fields to be frozen are determined, the reference weight value of each column where the reference fields to be frozen are determined according to the historical table operation information; and a preset style is added to and displayed for each column where the reference fields to be frozen according to the reference weight value of each column where the reference fields to be frozen are located.
4. The method for freezing data in a table view according to claim 1, characterized in that: The step of, in the case where a freezing instruction for target row data or target column data is detected, determining in the table view a target frozen row to which the target row data is to be frozen, or a target frozen column to which the target column data is to be frozen, comprises: When it is detected that a button indicating freezing of target row data or target column data is triggered, the target frozen row to which the target row data is frozen, or the target frozen column to which the target column data is frozen, is determined in the table view according to the freezing information corresponding to the triggered button, wherein the freezing information includes indication information of the target frozen row to which the target row data is frozen, or the target frozen column to which the target column data is frozen.
5. The method for freezing data in a table view according to claim 1, characterized in that: The determining, in the table view, a target frozen row to which the target row data is to be frozen, or a target frozen column to which the target column data is to be frozen, comprises: Determine a target field related to the reference field in the table view; use the row where the target field is located as the target frozen row, or use the column where the target field is located as the target frozen column; or A preset row or a preset column in the table view is selected, and the selected preset row is used as the target frozen row, or the selected preset column is used as the target frozen column.
6. The method for freezing data in a table view according to claim 1, characterized in that: After the target column data is copied to the target frozen column, and the target frozen column to which the target column data is copied is frozen in the table view through a sticky layout, the method further includes: When a horizontal sliding event for the table view is detected, the target column data is fixed to the target frozen column, and data of other unfixed columns slide horizontally based on the horizontal sliding event; When a vertical sliding event for the table view is detected, the target column data is vertically slid based on the vertical sliding event.
7. The method for freezing data in a table view according to claim 1, characterized in that: After the target row data is copied to the target frozen row, and the target frozen row to which the target row data is copied is frozen in the table view through a sticky layout, the method further includes: When a horizontal sliding event for the table view is detected, the target row data slides horizontally based on the horizontal sliding event; When a vertical sliding event for the table view is detected, the target row data is fixed to the target frozen row, and data of other unfixed rows slide vertically based on the vertical sliding event.
8. A device for freezing data in a table view, characterized in that: include: A first determination module is used to determine the row or column where the reference field to be frozen is located in the table view; A second determination module is used to determine, in the table view, a target frozen row to which the target row data is to be frozen, or a target frozen column to which the target column data is to be frozen, when a freezing instruction for target row data or target column data is detected, wherein the target row data is data of the row where the reference field is located, and the target column data is data of the column where the reference field is located; A freezing module, used for copying the target row data to the target frozen row, and freezing the target frozen row with the target row data copied to the table view through sticky layout, including: copying the target row data to the target frozen row, and sequentially moving the original data of the target frozen row so that the original data avoids the target row data; setting the position attribute in the cell style of the target frozen row to the sticky attribute, and setting the row to which the target frozen row adheres in the table view, so as to freeze the target frozen row with the target row data copied to the table view; Alternatively, the method is used to copy the target column data to the target frozen column, and freeze the target frozen column with the target column data copied thereto in the table view through a sticky layout, including: copying the target column data to the target frozen column, and sequentially moving the original data of the target frozen column so that the original data avoids the target column data; setting the position attribute in the cell style of the target frozen column to a sticky attribute, and setting the column to which the target frozen column adheres in the table view, so as to freeze the target frozen column with the target column data copied thereto in the table view.
9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the method for freezing data in a table view according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method for freezing data in a table view according to any one of claims 1 to 7 when running.
