Summary of the invention
What the embodiment of the present invention solved is how easily to choose to the data in web form.
To solve the above problems, the embodiment of the invention provides a kind of choosing method of web form data, the method packet
It includes:
Judge whether preset key is pressed;
When determining that the preset key is pressed, and when the cell in the table is clicked, the table is judged
In whether data with existing is selected;
When determine there are data to be selected in the table, according to the preset key being pressed, the table is chosen
Corresponding data in lattice;
When determining that the preset key is not pressed, single choice state is set by the table.
Optionally, described when the determining preset key is pressed, and the cell in the table is clicked, sentence
Breaking in the table, whether data with existing is selected, comprising:
Judge whether preset variable is greater than preset threshold value;
When the variable is greater than the threshold value, determine in the table that having data line is selected, it will be described selected
In data line as the first row data;
When the variable is equal to preset threshold value, determining in the table does not have data selected.
Optionally, the preset key is the first key, the second key or third key.
Optionally, using the cell chosen be expert in data as the second row data, it is described described in determine
When there are data to be selected in table, according to the preset key pressed, corresponding data in the table are chosen, comprising:
When determining that first key is pressed, judge whether the first row data with the second row data are same
Data line;
When determining the first row data and the second row data is same data line, then by the first row data
It is set as unchecked state;
When determining the first row data and the second row data is not same data line, then by second line number
According to being set as selected state.
Optionally, using the cell chosen be expert in data as the second row data, it is described described in determine
When there are data to be selected in table, according to the preset key pressed, corresponding data in the table are chosen, comprising:
When determining that second key is pressed, choose the first row data, second line number accordingly and described
The data of all rows between the first row data and the second row data.
Optionally, using the cell chosen be expert in data as the second row data, it is described described in determine
When there are data to be selected in table, according to the preset key pressed, corresponding data in the table are chosen, comprising:
When determining that the third key is pressed, unselected state is set by the first row data;
The data in cell chosen described in acquisition;
Traverse the data in other cells for the cell column chosen described in the table;
When the data in other described cells are identical as the data in the cell chosen, described second is chosen
Row data and other cells data of the row identical with the data in the cell chosen.
Optionally, first key, the second key and third key are respectively that Ctrl key, Shift key and Alt are pressed
Key.
The embodiment of the present invention also provides a kind of selecting device of web form data, and described device includes:
First judging unit, judges whether preset key is pressed;
Second judgment unit, when determining that the preset key is pressed, and when the cell in the table is clicked,
Judge whether data with existing is selected in the table;
Data selecting unit, suitable for when determine has data to be selected in the table, according to it is described be pressed it is default
Key, choose corresponding data in the table;
Setting unit, suitable for setting single choice state for the table when determining that the preset key is not pressed.
Optionally, the second judgment unit includes:
First judgment sub-unit, suitable for judging whether preset variable is greater than preset threshold value;
First determines subelement, is suitable for determining have a line number in the table when the variable is greater than the threshold value
According to being selected, using the selected data line as the first row data;
Second determines subelement, is suitable for determining in the table do not there is data when the variable is equal to preset threshold value
It is selected.
Optionally, the preset key is the first key, the second key or third key.
Optionally, using the cell chosen be expert in data as the second row data, the data decimation list
Member includes:
Second judgment sub-unit, suitable for judging the first row data and institute when determining that first key is pressed
State whether the second row data are same data line;
Third determines subelement, suitable for being same data line when the determining the first row data and the second row data
When, then unchecked state is set by the first row data;
First chooses subelement, suitable for not being same data line when the determining the first row data and the second row data
When, then selected state is set by the second row data.
Optionally, using the cell chosen be expert in data as the second row data, the data decimation list
Member includes:
Second chooses subelement, suitable for when determining that second key is pressed, choosing the first row data, described
The data of second line number all rows accordingly and between the first row data and the second row data.
Optionally, using the cell chosen be expert in data as the second row data, the data decimation list
Member includes:
4th determines subelement, suitable for setting the first row data to when determining that the third key is pressed
Unselected state;
Subelement is obtained, suitable for the data in the cell chosen described in obtaining;
Subelement is traversed, the number in other cells suitable for traversing the cell column chosen described in the table
According to;
Third chooses subelement, suitable for when the data in other described cells and the data in the cell chosen
When identical, choose the second row data and other cells identical with the data in the cell chosen of the row
Data.
Optionally, first key, the second key and third key are respectively that Ctrl key, Shift key and Alt are pressed
Key.
Compared with prior art, technical solution of the present invention has the advantage that
By using preset key, where clicking a cell or the cell chosen in web form
Row data when, multirow data can be chosen simultaneously, so that can simplify when selecting the data in web form
The selection operation of data, simple and easy to do in web form, thus the working efficiency of web form can be improved.
Specific embodiment
To solve the above-mentioned problems in the prior art, technical solution used in the embodiment of the present invention is by using default
Key, can will have the data of certain same alike results select simultaneously with the data clicked in the row or cell chosen
In, so that can simplify operation when selecting the data in web form, it is simple and easy to do.
To make the above purposes, features and advantages of the invention more obvious and understandable, with reference to the accompanying drawing to the present invention
Specific embodiment be described in detail.
Fig. 1 shows the flow chart of the choosing method of one of embodiment of the present invention web form data.As shown in Figure 1
Web form data choosing method, may include:
Step S101: judge whether preset key is pressed.
When the judgment result is yes, step S102~S103 can be executed, conversely, can then execute step S104.
Step S102: when the cell in the table is clicked, judge whether data with existing is selected in the table
In.
In specific implementation, when clicking the cell in the table, the data of the row where the cell will
It is selected, wherein the cell can be any cell in the row.
When the judgment result is yes, step S103 can be executed, conversely, not executing any operation then.
Step S103: according to the preset key being pressed, corresponding data in the table are chosen.
In specific implementation, when first key, the second key or third key are pressed, in the table
Corresponding data can be selected, so that the selection of the data in web form is more convenient, it is easily operated.
Step S104: single choice state is set by the table.
In specific implementation, described to set single choice state for the table and refer to: in the table described in the user click
When data, only the data that the last time clicks are chosen, and the data clicked before are converted into unchecked state.
Fig. 2 shows the flow charts of the choosing method of another web form data in the embodiment of the present invention.Such as Fig. 2 institute
The choosing method for the web form data shown may include:
Step S201: judge whether preset key is pressed.
In specific implementation, the preset key can be the first key, the second key or third key, described the
One key, the second key and third key can be respectively Ctrl key, Shift key and Alt key.
When the judgment result is yes, step S203~S208 can be executed, otherwise, then can execute step S202.
Step S202: single choice state is set by the table.
In specific implementation, described to set single choice state for the table and refer to: in the table described in the user click
When data, only the data that the last time clicks are chosen, and the data clicked before are converted into unchecked state.
Step S203: when the cell in the table is clicked, judge whether preset variable is greater than preset threshold
Value.
In specific implementation, the design variables can be used for recording in the web form where user institute click data
Row mark information.
For example, in the initial state, the variable can be equal to the preset threshold value, the variable can be equal to-
1.And when there is data to be selected in web form, the value of the variable can be equal to chosen data number of the row, such as
When the user clicks in web form when the 15th row data, the value of design variables can be equal to 15.
When the judgment result is yes, step S205 can be executed, conversely, can then execute step S204.
Step S204: determining does not have data selected in the table.
In specific implementation, the variable is equal to the preset threshold value in the initial state, and has when in web form
When data are selected, the value of the variable will be equal to chosen data number of the row.Therefore, when the value of the variable
When equal to preset threshold value, then it can determine that there has been no data to be selected in the web form.
Step S205: determine in the table that having data line is selected.
In specific implementation, since when there is data to be selected in web form, the value of the variable will be equal to be chosen
Data number of the row.Therefore, when the value of the variable is greater than preset threshold value, then the web form can be determined
Middle data with existing is selected.
It, can be using the selected data line as the first row data for the ease of distinguishing and describing.
In specific implementation, when determine chosen the first row data in the table when, according to be pressed it is preset by
Key is different, can execute following step S206, S207 or S208 respectively.
Step S206: when determining that Ctrl key is pressed, corresponding data in the table are chosen.
It refers to shown in Fig. 2 a, when determining that the Ctrl key is pressed, step S206a~S206c can be executed.
Step S206a: judge whether the first row data and the second row data are same data line.
It is to be herein pointed out when clicking the cell in the web form, row where the cell
Data will be arranged to selected state.It for ease of description, can be by the number of the row where the cell clicked and chosen
According to as the second row data.
It in specific implementation,, can by clicking the cell in the table when determining that the Ctrl key is pressed
The data chosen are converted to unchecked state, unchecked data can also be chosen.Therefore, in order to further true
Determining user is that data will have been chosen to be converted to unchecked state, or unchecked data are converted to selected state, can be with
First choice judges whether the first row data and the second row data are same data line.
When the judgment result is yes, step S206b can be executed, conversely, can then execute step S206c.
Step S206b: unchecked state is set by the first row data.
In specific implementation, when the first row data are identical as the second row data, then the first row data be may indicate that
(or second row data) have been selected.At this point, by again tapping on the first row data, it can be by the first row data by original
The selected state come is converted to unchecked state.
Step S206c: selected state is set by the second row data.
It in specific implementation, can when determining the first row data and the second row data is not same data line
To determine that user click the second row data are in order to choose the second row data, at this point it is possible to choose the second row data.
Therefore, it by the combination operation of the Ctrl key and the cell clicked in table, can choose in web form
Unchecked data line, alternatively, the data in the web form chosen can be converted to unchecked state.
In specific implementation, when determining that the Shift key is pressed, step S207 can be executed: described in determining
When Shift key is pressed, corresponding data in the table are chosen.
It specifically, can be by the first row data, the cell institute when determining that the Shift key is pressed
The second row data and the first row data and the second row data between the data of all rows choose
For example, when the first row data are the 15th row data, and when Shift key is pressed, it is clicked by right mouse button
Any one cell in the 20th row in the table, can be by all numbers of the 15th row~20 rows in the table
It is chosen according to whole.
Therefore, by Shift key and the combination operation for clicking cell, the first row clicked and chosen can not only be chosen
Data and the second row data, can also choose all data between the first row data and the second row data simultaneously.
In specific implementation, when determining that the Alt key is pressed, step S208 can be executed: determining the Shift
When key is pressed, corresponding data in the table are chosen.
It refers to shown in Fig. 2 b, when determining that the Alt key is pressed, step S208a~S208c can be executed.
Step S208a: unselected state is set by the first row data.
In specific implementation, when Alt key is pressed, if having been chosen before clicking the cell in the table
The first row data, no matter in the first row data, be located at the cell data in the cell of same row with it is described
Whether the data clicked in the cell chosen are identical, can be converted into unchecked state first.
Step S208b: the data in cell chosen described in acquisition.
In specific implementation, by obtaining the data clicked in the cell chosen when Alt key is pressed, so as to
It may determine that the data being located in the cell of same row with the cell click the list chosen with described in following step
Whether the data in first lattice are identical.
Step S208c: the data in other cells for the cell column chosen described in the table are traversed.
In specific implementation, be located to determine other with the cell data in the cell of same row with it is described
Whether the data clicked in the cell chosen are identical, can traverse other described cells first, to obtain other described lists
Data in first lattice.
Step S208d: judge data in other described cells and the data in the cell chosen whether phase
Together.
When the judgment result is yes, step S208e can be executed, conversely, then terminating.
Step S208e: the second row data and other lists identical with the data in the cell chosen are chosen
First lattice data of the row.
In specific implementation, when in the table cell and the cell chosen of clicking be located at same row, and
When data in the cell are identical as the data clicked in the cell chosen, the cell institute can be chosen
Row in all data.Conversely, data in the cell and the data clicked in the cell chosen not phase
Meanwhile all data in the row where other described cells will not be then selected.
It in specific implementation, can be by institute by the combination operation of Alt key and the cell clicked in the table
It states and is located at identical column in table with the cell, and the data in cell and the number clicked in the cell chosen
It is chosen according to identical cell data of the row.
For example, when Alt key is pressed, when the data for clicking in the cell chosen are " Zhang San ", if the list
First lattice and the cell chosen of clicking are located at same row, and when the data in the cell are also " Zhang San ", then described in
The data of full line where cell will be shown as the state chosen.Conversely, then the data in the row where the table are then
It will not be selected.
Fig. 3 shows the structural schematic diagram of the selecting device of one of embodiment of the present invention web form data.Such as Fig. 3
Shown in web form data selecting device, may include the first judging unit 301, second judgment unit 302, data decimation
Unit 303 and setting unit 304, in which:
First judging unit 301, suitable for judging whether preset key is pressed.
The second judgment unit 302, suitable for being pressed when the determining preset key, and the unit in the table
When lattice are clicked, judge whether data with existing is selected in the table.
The data selecting unit 303, suitable for being pressed according to described when determine has data to be selected in the table
Preset key, choose corresponding data in the table.
The setting unit 304, suitable for setting single for the table when determining that the preset key is not pressed
Select state.
Fig. 4 shows the structural schematic diagram of the first judging unit of one of embodiment of the present invention.As shown in Figure 4 first
Judging unit 400, including the first judgment sub-unit 401, first determine that subelement 402 and second determines subelement 403, in which:
First judgment sub-unit 401, suitable for being pressed when the determining preset key, and the list in the table
When first lattice are clicked, judge whether preset variable is greater than preset threshold value.
Described first determines subelement 402, is suitable for determining in the table and having when the variable is greater than the threshold value
Data line is selected, using the selected data line as the first row data.
Described second determines subelement 403, is suitable for determining in the table not when the variable is equal to preset threshold value
There are data selected.
In specific implementation, the preset key can be the first key, the second key or third key.Described first
Key, the second key and third key are respectively Ctrl key, Shift key and Alt key.
In specific implementation, the data in the cell chosen being expert at are as the second row data.
Fig. 5 shows the structural schematic diagram of one of embodiment of the present invention data selecting unit.Data as shown in Figure 5
Selection unit 500 may include that the second judgment sub-unit 501, third determine that subelement 502 and described first chooses subelement
503, in which:
Second judgment sub-unit 501, suitable for judging first line number when determining that first key is pressed
It whether is same data line according to the second row data.
The third determines subelement 502, suitable for being same when the determining the first row data and the second row data
When row data, then unchecked state is set by the first row data.
Described first chooses subelement 503, suitable for not being same when the determining the first row data and the second row data
When data line, selected state is set by the second row data.
In specific implementation, data selecting unit 500 as shown in Figure 5 can also include the second selection subelement 504,
In:
Described second chooses subelement 504, suitable for choosing first line number when determining that second key is pressed
According to, second line number accordingly and between the first row data and the second row data all rows data.
In specific implementation, data selecting unit 500 as shown in Figure 5 can also include the 4th determining subelement 505, obtain
Subelement 506, traversal subelement 507 and third is taken to choose subelement 508, in which:
Described 4th determines subelement 505, suitable for when determining that the third key is pressed, by the first row data
It is set as unselected state.
The acquisition subelement 506, suitable for the data in the cell chosen described in obtaining.
The traversal subelement 507, suitable for traversing other units for the cell column chosen described in the table
Data in lattice.
The third chooses subelement 508, suitable for working as data and the cell chosen in other described cells
In data it is identical when, choose the second row data and other cells identical with the data in the cell chosen
Data of the row.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of above-described embodiment is can
It is completed with instructing relevant hardware by program, which can store in computer readable storage medium, and storage is situated between
Matter may include: ROM, RAM, disk or CD etc..
The method and system of the embodiment of the present invention are had been described in detail above, the present invention is not limited thereto.Any
Field technical staff can make various changes or modifications without departing from the spirit and scope of the present invention, therefore guarantor of the invention
Shield range should be defined by the scope defined by the claims..