Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing the devices, modules or units, and are not used for limiting the devices, modules or units to be different devices, modules or units, and also for limiting the sequence or interdependence relationship of the functions executed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The following describes the technical solutions of the present disclosure and how to solve the above technical problems in specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present disclosure will be described below with reference to the accompanying drawings.
Referring to fig. 1, the present disclosure provides a page table rendering method, including:
s101, acquiring a query request of a user for scrolling a page form;
s102, determining a target cell of the page table displayed in a visual area according to the query request;
s103, rendering the elements in the target cell.
In the embodiments of the present disclosure, the execution subject is taken as an example for explanation, but the execution subject is not limited thereto.
In step S101, an inquiry request for a user to scroll a page form is obtained, specifically, the page form may be a form loaded for presentation on a page; the page form comprises a custom scroll bar bound with the page form, and when a user triggers the interactive interface to perform an operation (such as a sliding operation), the page form is responded to scrolling. The query request is triggered by the user when scrolling through the page table.
In step S102, a target cell of the page table displayed in a visual area is determined according to the query request, specifically, the visual area may be an area corresponding to the size of the terminal interactive interface, or an area for page table display that is self-adjusted by the user after the user performs a screen splitting operation. In one embodiment, the area of the page table that needs to be displayed is larger than the area of the visible region (e.g., the page table includes a number of rows that is larger than the number of rows that can be covered by the visible region), then only a portion of the page table can be displayed in the visible region, and the rest of the page table can be scrolled and viewed by the user. When the user scrolls the page table to trigger the query request, the content of the page table which is required to be displayed in the visible area currently by the user can be determined through the query request, and therefore the target cell of the page table displayed in the visible area is determined. The target cells may be all cells of the page table currently displayed in the visible area.
In step S103, rendering the elements in the target cell, specifically, in the page table, the elements of the page table are carried by each cell, and after the target cell is determined in step S102, obtaining the elements in the target cell for rendering, and the elements in the cells other than the target cell in the page table are not rendered; that is, the elements of the target cell that the page table displays in the visible area are rendered, and the elements of the cells of the page table outside the visible area are not rendered.
When a query request of a user for scrolling a page table is obtained, a target cell of the page table displayed in a visual area is determined according to the query request, and elements in the target cell are rendered. Wherein, the inquiry request triggered by the user scrolling the page table can change the relative position of the page table in the visual area so as to change the target unit displayed in the visual area by the page table; when a target unit is determined based on the query request, elements of the target unit are rendered. The method determines the target cell currently displayed in the visible area of the page table through the query request, and renders the elements of the part of cells, namely renders the elements of the cells visible to the current user, but does not need to render the elements of the cells invisible to the user, thereby greatly reducing the rendered elements and reducing the rendering cost of the page table; furthermore, due to the reduction of rendering elements, the memory occupied by the form component is not obviously improved due to the increase of the number of elements of the page form, the probability of page jamming is reduced, the page display fluency is maintained, and the user experience is improved.
In this embodiment of the present disclosure, optionally, referring to fig. 2, after acquiring the query request of the user for scrolling the page table in step S101, the method includes:
s201, cell data initialized by the page table is called, and the page table comprises a two-dimensional array formed by a row array and a column array.
In the disclosed embodiment, the page table is initialized as follows:
the method calls in step S101 by creating a < scroll-view > tag as a container tag of the page table, setting it as contin, and binding a custom scrollbar bindscroll function.
Setting a variable T aiming at a page table, wherein the T is a two-dimensional array, and the two-dimensional array comprises m rows and n columns; in one embodiment, the values of the non-two-dimensional arrays in the variable T are uniformly set as an object, the attribute of the object is set as visible, and the corresponding value is true, that is, the values of the non-two-dimensional arrays in the variable T are always in a visible display state.
For a row of the page table, a < view > tag is created as a row container tag of the page table, set to TB. Specifically, when a line is being rendered, the variable T is traversed and m TBs are rendered in continue using the function of loop rendering.
For a cell of the page table, a < view > tag is created as a tag of the cell of the page table, set to TC. Specifically, when a cell is rendered, the m-th value of the variable T is taken from m TBs rendered in the continue, and since the variable T is a two-dimensional array, the m-th value of the variable T is also an array, and based on the array, n cells TC are rendered in the m-th TB by using a loop rendering function. Further, with the conditional rendering function, when the attribute visible of the nth value of the mth value of the variable T is true, an input tag is inserted in the TC, otherwise, no control is inserted. In one embodiment, the value of attribute class of TC is set to "tbmtrn", when the cell in row 2 and column 2 is listed, the value of attribute class is "tb 2 tr 2", correspondingly, the value of attribute data-tb is m, and the value of attribute data-tr is n, so as to query and judge the position of the cell.
Specifically, a page table is created with a < view > tag for each row, and each column of each row is aligned on a vertical line. In the embodiment of the disclosure, of m rows and n columns included in the two-dimensional array, m and n may be set to be larger values, for example, larger than the number of rows and the number of columns that can be covered in the visible area.
In the embodiment of the present disclosure, since the changed page table is displayed in the target cell in the visible area when one query request is obtained, the corresponding attribute value of the changed page table needs to be reconfigured, for this reason, when each query request is obtained, the cell data initialized by the page table is called, specifically, as follows: and if the attribute visible of a certain cell is true, initializing the attribute value when acquiring the query request. For another example: if the value of the attribute left in the attribute position of a cell is 1 and the value of the attribute right is x2, the value of the attribute position is set to absolute when the query request is obtained. In one embodiment, the initialized cell data is the data of the two-dimensional array in the variable T, and the non-array values thereof do not need to be initialized.
In an embodiment, the cell data initialized by the page table is called, and the page table includes a two-dimensional array composed of a row array and a column array, and it can be further understood that the cell data of the page table is initialized when the query request is obtained.
In this embodiment of the present disclosure, optionally, the step S102, determining, according to the query request, a target cell of the page table displayed in the visible area, includes:
and acquiring the boundary information of the visual area according to the query request.
Specifically, when the visual area is a dynamically adjustable area, the boundary information of the visual area, such as the position information of the first boundary in the terminal interaction interface, is obtained according to the query request. I.e. the query request comprises boundary information data of the visual area. For example, the size of a response page (the area of the response page is smaller than that of the terminal interaction interface) of the current query request is obtained, and the size of the response page is taken as the position size information of the visible region.
In this disclosure, referring to fig. 3, optionally, the step S102 determines, according to the query request, a target cell of the page table displayed in the visible area, including:
s301, determining a target column group displayed by the two-dimensional array in the visual area according to the query request;
s302, determining a target row array displayed by the two-dimensional array in the visual area according to the query request;
s303, setting visible attributes of the cells in the two-dimensional array according to the target column group and the target row group; wherein the visible attribute comprises a first parameter characterizing a visible display state and a second parameter characterizing an invisible display state;
s304, determining the cell with the visible attribute as the first parameter as the target cell.
In step S301, a target column group of the two-dimensional array displayed in the visible area is determined according to the query request, specifically, a target column group covered by the current visible area is determined according to the query request, specifically, a column number of cells covered by the visible area when the page table is displayed in the visible area is determined.
In step S302, a target row array displayed in the visual area by the two-dimensional array is determined according to the query request, specifically, a target row array covered by the current visual area is determined according to the query request, specifically, a row number of cells covered by the visual area when the page table is displayed in the visual area is determined.
In step S303, setting visible attributes of cells in the two-dimensional array according to the target column group and the target row group; specifically, after the target column group is determined through step S301 and the target row group is determined through step S302, the visible attribute of the cell may be assigned according to the column number and the row number of the cell covered by the visible area, where the visible attribute is attribute visible; wherein the visible attribute comprises a first parameter characterizing a displayable state and a second parameter characterizing a non-visible display state. Specifically, the cells in the displayable state of the page table are displayed in the visible area, and the cells in the non-displayable state of the page table are outside the visible area. The first parameter may be that the value of the attribute visible is true, and the second parameter may be that the value of the attribute visible is false.
In step S304, the cell with the visible attribute as the first parameter is determined as the target cell, specifically, the cell with the attribute visible as the first parameter true is determined as the target cell, that is, is displayed in the visible area.
In this embodiment of the present disclosure, optionally, referring to fig. 4, step S301, according to the query request, determines a target column group of the two-dimensional array displayed in the page table, where the determining includes:
s401, acquiring the position information of each cell in a target row in the two-dimensional array according to the query request;
s402, calculating a first distance between each cell and a first boundary and a second distance between each cell and a second boundary of the visible area based on the position information; wherein the first and second boundaries constitute a lateral length of the viewable area;
s403, forming the target column group by using the column numbers corresponding to the cells with the first distance and the second distance both greater than the first preset threshold.
Specifically, the embodiment of the present disclosure initializes the ATB variable as a null array for storing the number of columns of the cells in one row of the visible area. Using the method createSelectorQuery and returning, object SelectorQuery can be obtained, and using the method selectrorall of object SelectorQuery, parameter tb can be obtained, e.g., the tag with tb1 in all attribute classes (the tag in the first row) is selected.
In step S401, the location information of each cell in the target row in the two-dimensional array is obtained according to the query request, specifically, a method bounding clientrect is executed, a method exec callback is executed, and the location information of the cell is dynamically obtained through the query request. Specifically, the location information includes the location size of the cell, such as the width and height attributes. The target row may be any one or more rows included in the row group of the two-dimensional array.
In step S402, based on the position information, a first distance between each cell and a first boundary and a second distance between each cell and a second boundary of the visible region are calculated; wherein the first boundary and the second boundary constitute a lateral length of the visible area, and specifically, a first distance from the first boundary and a second distance from the second boundary of the visible area may be an attribute left and an attribute right in an attribute position of a cell. Wherein the first boundary and the second boundary form a lateral length of the visual area, wherein the first boundary may be a left boundary of the visual area, and the second boundary may be a right boundary of the visual area.
After the position information of each cell is determined in step S401, the position information of all the cells in the target row is stored in an array and set as ares, that is, each item in the array ares is the position information of the cell. By traversing the array ares, the attributes left and right of the cell are determined.
For example, referring to fig. 8, the inner area shown by the solid black line in fig. 8 is a visible area, the cell (solid line) in the visible area is a target cell, the cell (dotted line) outside the visible area is a cell that the page table cannot currently display in the visible area (in fig. 8, the dotted line represents an infinitely expandable row and column that is not displayed in the visible area in the page table, and the dotted line does not exist in practical applications, and the dotted line in fig. 8 is only made for better describing the embodiment of the present disclosure), wherein the shaded portion may be understood as a non-array value in the variable T. Assuming that the lateral length formed by the first boundary and the second boundary of the visible region is 5cm, when the width of the cell in the target row is determined to be 1cm in step S401, the first distance of the cell a from the first boundary (left boundary) of the visible region is determined to be 2cm, and the second distance of the cell a from the second boundary (right boundary) of the visible region is determined to be 2cm, with the first boundary (left boundary) of the visible region as a reference. The first distance of cell B from the first border (left border) of the visible area is 6cm and the second distance of cell B from the second border (right border) of the visible area is-2 cm.
In step S403, the target column group is formed by the number of columns corresponding to the cells whose first distance and second distance are both greater than a first preset threshold, specifically, in the embodiment of the present disclosure, the first preset threshold is preferably 0; explaining the example following the step S402, if the first distance of the current cell a is 2cm and the second distance is 2cm, both of them are greater than the first preset threshold 0, then the column number XA of the cell a is added to the empty array of the ATB variable to form the target column group. If the first distance of the current cell B is 6cm and the second distance is-2 cm, the condition that both are greater than the first preset threshold 0 is not satisfied, and the number of columns XB in which the current cell B is located cannot be one item of the target column group. The number of columns in which the cells are located can be obtained by obtaining the value of the attribute' dataset.
In this disclosure, optionally, referring to fig. 5, the determining, in step S302, a target row array of the two-dimensional array displayed in the visible area according to the query request includes:
s501, acquiring the position information of each cell in a target column in the two-dimensional array according to the query request;
s502, based on the position information, calculating a third distance from the cell to a third boundary of the visible region and a fourth distance from a fourth boundary; wherein the third and fourth boundaries comprise a longitudinal length of the viewable area;
s503, forming the target row array by the row number corresponding to the cell with the third distance and the fourth distance both being larger than a second preset threshold value.
Specifically, the disclosed embodiment initializes the ATR variable as an empty array for storing the number of rows of cells in a column of the visible area. Using the method createSelectorQuery and returning, an object SelectorQuery can be obtained, and using the method selectrorl of object SelectorQuery, a parameter tr can be obtained, such as selecting the tag with tr1 in all attribute classes (the tag in the first column).
In step S501, the location information of each cell in the target column in the two-dimensional array is obtained according to the query request, specifically, a method bounding clientrect is executed, a method exec callback is executed, and the location information of the cell is dynamically obtained through the query request. Specifically, the location information includes the location size of the cell, such as the width and height attributes. The target column may be any one or more columns of columns included in the column group of the two-dimensional array.
In step S502, based on the position information, a third distance between each cell and a third boundary and a fourth distance between each cell and a fourth boundary of the visible region are calculated; the third boundary and the fourth boundary constitute a longitudinal length of the visible area, and specifically, a third distance from the third boundary and a fourth distance from the fourth boundary of the visible area may be an attribute top and an attribute bottom in the attribute position of the cell. The third boundary and the fourth boundary form a longitudinal length of the visual area, wherein the third boundary may be an upper boundary of the visual area, and the fourth boundary may be a lower boundary of the visual area.
After the position information of each cell is determined in step S501, the position information of all the cells in the target row is stored in an array and set as ares, that is, each item in the array ares is the position information of the cell. And determining the attribute top and the attribute bottom of the cell by traversing the array ares.
For example, referring to fig. 9, the inner area shown by the solid black line in fig. 9 is a visible area, the cell (solid line) in the visible area is a target cell, the cell (dotted line) outside the visible area is a cell that the page table cannot currently display in the visible area (in fig. 9, the dotted line represents an infinitely expandable row and column that is not displayed in the visible area in the page table, and the dotted line does not exist in practical applications, and the dotted line in fig. 9 is only made for better describing the embodiment of the present disclosure), wherein the shaded portion may be understood as a non-array value in the variable T. Assuming that the vertical length formed by the third boundary and the fourth boundary of the visible region is 9.8cm, when it is determined in step S501 that the height of a cell in the target column is 0.7cm, the first distance from the cell C to the third boundary (upper boundary) of the visible region is 3.5cm and the fourth distance from the cell C to the fourth boundary (lower boundary) of the visible region is 5.6cm, based on the third boundary (upper boundary) of the visible region. The third distance of the cell D from the third boundary (upper boundary) of the visible region is-0.7 cm, and the fourth distance of the cell D from the fourth boundary (lower boundary) of the visible region is 9.8 cm.
In step S503, the line numbers corresponding to the cells whose third distance and fourth distance are both greater than a second preset threshold value are combined into the target line array, specifically, in the embodiment of the present disclosure, the second preset threshold value is preferably 0; as explained in the following example in step S502, if the third distance of the current cell C is 3.5cm and the fourth distance is 5.6cm, both of them are greater than the second preset threshold 0, then the column number YC of the cell C is added to the empty array of the ATR variable to form the target row array. And if the third distance of the current cell D is-0.7 cm and the fourth distance is 9.8cm, the condition that both the third distance and the fourth distance are greater than a second preset threshold value 0 is not met, and the row number YB where the current cell D is located cannot become one item of the target row array. The line number of the cell can be obtained by obtaining the value of the attribute 'dataset.tb' of the cell.
In the embodiment of the present disclosure, the first preset threshold and the second preset threshold may be the same or different; preferably, the first preset threshold is the same as the second preset threshold.
In this disclosure, referring to fig. 6, optionally, step S303 sets visible attributes of cells in the two-dimensional array according to the target column group and the target row group, where the visible attributes include:
s601, setting the visible attribute of the row parameter of the cell in the target row number group as the first parameter, and setting the visible attribute of the row parameter of the cell outside the target row number group as the second parameter;
s602 sets the visible attribute of the column parameter of the cell in the target column group as the first parameter, and sets the visible attribute of the column parameter of the cells outside the target column group as the second parameter.
Specifically, the attributes defining a cell include a row parameter and a column parameter; in step S601, setting the visible attributes of the row parameters of the cells in the target row number group as the first parameter, that is, setting the values of the attributes visible of the row parameters of all the cells in all the rows in the target row number group as true; in step S602, the visible attribute of the column parameter of the cell in the target column group is set as the first parameter, and specifically, the values of the attributes visible of the column parameters of all the cells in all the columns in the target column group are set as true. In addition, the values of the attributes visible of the cells outside the target row array in the page table are all set to false, and the values of the attributes visible of the cells outside the target column array in the page table are set to false.
In this embodiment of the present disclosure, optionally, the step S303 sets the visible attributes of the cells in the two-dimensional array according to the target column group and the target row group, where the setting includes:
obtaining each cell with the maximum row number in the two-dimensional array;
comparing the column number of each unit cell with the maximum row number with the target column group; when the column number of each cell with the largest row number belongs to the target column group, setting the visible attributes of all the cells with the largest row number in the column number of each cell as first parameters; otherwise, setting the visible attributes of all the cells as second parameters;
acquiring each cell with the maximum number of columns in each cell with the maximum number of rows in the two-dimensional array;
comparing the row number of each cell with the maximum column number with the target row number group; when the row number of each cell with the maximum column number belongs to the target row array, setting the visible attribute of the cell with the row number of each cell with the maximum column number as a first parameter; the visible attributes of the remaining cells are set to the second parameter.
In the specific operation process, a traversal variable T is adopted; specifically, an mb-th entry in the variable T is obtained, if mb belongs to the ATB variable, that is, mb is in the target column group corresponding to the ATB variable, the attribute visibles of all objects in the array of m entries are set to true, otherwise, all entries are set to false. And acquiring the nr item of the mr item in the variable T, and if the nr item belongs to the ATR variable, namely the nr item is in the target row array corresponding to the ATR variable, setting the object attribute visible of the nr item in the mr item of the variable T as true, otherwise, setting the object attribute visible as false. Wherein mb is from 1 to m, mr is from 1 to m, and nr is from 1 to n.
In this disclosure, optionally, the step S304 determines the cell with the visible attribute as the first parameter as the target cell, including:
and determining the cells of which the visible attributes of the row parameters and the column parameters are the first parameters as target cells.
Specifically, a cell of which the visible attributes of the row parameter and the column parameter are the first parameters is obtained, and the cell is marked as a target cell. That is, the attribute visible of the row parameter of the target cell is true, and the attribute visible of the column parameter is false.
In the embodiment of the disclosure, after the query request scrolled by the user is obtained, the variable T is re-rendered according to the condition, wherein the rendering specifically shows that the elements in the cells in the visible area are rendered, and the elements in the cells outside the visible area are not rendered; please refer to fig. 8 and fig. 9. The method effectively reduces the number of nodes, reduces the rendering cost, and is favorable for optimizing the performance of the infinitely expandable table.
Referring to fig. 7, a page table rendering apparatus 700 according to another embodiment of the present disclosure includes:
an obtaining module 701, configured to obtain a query request for a user to scroll a page table;
a determining module 702, configured to determine, according to the query request, a target cell of the page table displayed in the visible area;
a rendering module 703 for rendering the elements in the target cell.
Optionally, the apparatus 700 further comprises: and the calling module is used for calling the cell data initialized by the page table after the query request of the user for rolling the page table is obtained, and the page table comprises a two-dimensional array formed by a row array and a column array.
Optionally, the determining module 702 includes:
a column unit, configured to determine, according to the query request, a target column group displayed by the two-dimensional array in the visual area;
the row unit is used for determining a target row array displayed by the two-dimensional array in the visual area according to the query request;
the setting unit is used for setting the visible attributes of the cells in the two-dimensional array according to the target column group and the target row group; wherein the visible attribute comprises a first parameter characterizing a visible display state and a second parameter characterizing an invisible display state;
a determining unit, configured to determine the cell with the visible attribute as the first parameter as the target cell.
Optionally, the column unit includes:
the first obtaining subunit is used for obtaining the position information of each cell in the target row in the two-dimensional array according to the query request;
a first calculating subunit, configured to calculate, based on the location information, a first distance from each cell to a first boundary of the visible area and a second distance from each cell to a second boundary of the visible area; wherein the first and second boundaries constitute a lateral length of the viewable area;
and the first forming subunit is used for forming the target column group by using the column numbers corresponding to the cells of which the first distance and the second distance are both greater than a first preset threshold value.
Optionally, the row unit includes:
the second obtaining subunit is used for obtaining the position information of each cell in the target column in the two-dimensional array according to the query request;
a second calculating subunit, configured to calculate, based on the position information, a third distance from each cell to a third boundary of the visible area and a fourth distance from each cell to a fourth boundary; wherein the third and fourth boundaries comprise a longitudinal length of the viewable area;
and the second forming subunit is used for forming the target row array by the rows corresponding to the cells of which the third distance and the fourth distance are both greater than a second preset threshold value.
Optionally, the setting unit includes:
a row setting subunit, configured to set, as the first parameter, a visible attribute of a row parameter of a cell in the target row number group, and set, as the second parameter, a visible attribute of a row parameter of a cell outside the target row number group;
and the column setting subunit is configured to set the visible attribute of the column parameter of the cell in the target column group as the first parameter, and set the visible attribute of the column parameter of the cells outside the target column group as the second parameter.
Optionally, the determining unit includes:
and the determining subunit is used for determining the cells of which the visible attributes of the row parameters and the column parameters are the first parameters as target cells.
The page table rendering apparatus 700 is a modular description of a page content display method according to an embodiment of the present disclosure, and specific contents thereof are not described in detail in the apparatus.
Referring now to fig. 10, a block diagram of an electronic device (e.g., a terminal device) 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 10 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
The electronic device includes: a memory and a processor, wherein the processor may be referred to as the processing device 601 hereinafter, and the memory may include at least one of a Read Only Memory (ROM)602, a Random Access Memory (RAM)603 and a storage device 608 hereinafter, which are specifically shown as follows:
as shown in fig. 10, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 10 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable medium or any combination of the two. A computer readable medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the steps of: acquiring a query request of a user for scrolling a page form; determining a target cell of the page table displayed in a visual area according to the query request; rendering the elements in the target cell.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules or units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a module or unit does not in some cases constitute a limitation on the unit itself, for example, the retrieval module may also be described as "retrieving a query request from a user to scroll through a page form".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, there is provided a page table rendering method including:
acquiring a query request of a user for scrolling a page form;
determining a target cell of the page table displayed in a visual area according to the query request;
rendering the elements in the target cell.
Optionally, after the obtaining of the query request of the user for scrolling the page table, the method includes:
and calling the cell data initialized by the page table, wherein the page table comprises a two-dimensional array formed by a row array and a column array.
Optionally, the determining, according to the query request, a target cell of the page table displayed in the visible area includes:
determining a target column group displayed by the two-dimensional array in the visual area according to the query request;
determining a target row array displayed by the two-dimensional array in the visual area according to the query request;
setting visible attributes of the cells in the two-dimensional array according to the target column group and the target row group; wherein the visible attribute comprises a first parameter characterizing a visible display state and a second parameter characterizing an invisible display state;
determining the cell with the visible attribute as the first parameter as the target cell.
Optionally, the determining, according to the query request, a target column group of the two-dimensional array displayed in the page table includes:
acquiring the position information of each cell in a target row in the two-dimensional array according to the query request;
calculating a first distance between each cell and a first boundary of the visual area and a second distance between each cell and a second boundary of the visual area based on the position information; wherein the first and second boundaries constitute a lateral length of the viewable area;
and forming the target column group by using the column numbers corresponding to the cells with the first distance and the second distance both larger than a first preset threshold value.
Optionally, the determining, according to the query request, a target row array of the two-dimensional array displayed in the visual area includes:
acquiring the position information of each cell in a target column in the two-dimensional array according to the query request;
calculating a third distance from each cell to a third boundary and a fourth distance from each cell to a fourth boundary of the visual area based on the position information; wherein the third and fourth boundaries comprise a longitudinal length of the viewable area;
and forming the target row array by the row number corresponding to the cell with the third distance and the fourth distance both being larger than a second preset threshold value.
Optionally, the setting the visible attribute of the cell in the two-dimensional array according to the target column group and the target row group includes:
setting the visible attribute of the row parameter of the cell in the target row number group as the first parameter, and setting the visible attribute of the row parameter of the cell outside the target row number group as the second parameter;
and setting the visible attribute of the column parameter of the cell in the target column group as the first parameter, and setting the visible attribute of the column parameter of the cell outside the target column group as the second parameter.
Optionally, the determining the cell with the visible attribute as the first parameter as the target cell includes:
and determining the cells of which the visible attributes of the row parameters and the column parameters are the first parameters as target cells.
According to one or more embodiments of the present disclosure, there is provided a page table rendering apparatus including:
the acquisition module is used for acquiring a query request of a user for scrolling a page form;
the determining module is used for determining a target cell displayed in a visual area by the page table according to the query request;
a rendering module to render the elements in the target cell.
Optionally, the apparatus further comprises: and the calling module is used for calling the cell data initialized by the page table after the query request of the user for rolling the page table is obtained, and the page table comprises a two-dimensional array formed by a row array and a column array.
Optionally, the determining module includes:
a column unit, configured to determine, according to the query request, a target column group displayed by the two-dimensional array in the visual area;
the row unit is used for determining a target row array displayed by the two-dimensional array in the visual area according to the query request;
the setting unit is used for setting the visible attributes of the cells in the two-dimensional array according to the target column group and the target row group; wherein the visible attribute comprises a first parameter characterizing a visible display state and a second parameter characterizing an invisible display state;
a determining unit, configured to determine the cell with the visible attribute as the first parameter as the target cell.
Optionally, the column unit includes:
the first obtaining subunit is used for obtaining the position information of each cell in the target row in the two-dimensional array according to the query request;
a first calculating subunit, configured to calculate, based on the location information, a first distance from each cell to a first boundary of the visible area and a second distance from each cell to a second boundary of the visible area; wherein the first and second boundaries constitute a lateral length of the viewable area;
and the first forming subunit is used for forming the target column group by using the column numbers corresponding to the cells of which the first distance and the second distance are both greater than a first preset threshold value.
Optionally, the row unit includes:
the second obtaining subunit is used for obtaining the position information of each cell in the target column in the two-dimensional array according to the query request;
a second calculating subunit, configured to calculate, based on the position information, a third distance from each cell to a third boundary of the visible area and a fourth distance from each cell to a fourth boundary; wherein the third and fourth boundaries comprise a longitudinal length of the viewable area;
and the second forming subunit is used for forming the target row array by the rows corresponding to the cells of which the third distance and the fourth distance are both greater than a second preset threshold value.
Optionally, the setting unit includes:
a row setting subunit, configured to set, as the first parameter, a visible attribute of a row parameter of a cell in the target row number group, and set, as the second parameter, a visible attribute of a row parameter of a cell outside the target row number group;
and the column setting subunit is configured to set the visible attribute of the column parameter of the cell in the target column group as the first parameter, and set the visible attribute of the column parameter of the cells outside the target column group as the second parameter.
Optionally, the determining unit includes:
and the determining subunit is used for determining the cells of which the visible attributes of the row parameters and the column parameters are the first parameters as target cells.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination. Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.