Difference between revisions of "BROWSE"
From Lianjapedia
Yvonne.milne (Talk | contribs) |
Yvonne.milne (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
Data grid | Data grid | ||
Line 6: | Line 4: | ||
==Syntax== | ==Syntax== | ||
BROWSE | BROWSE | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[FIELDS <field list>] | [FIELDS <field list>] | ||
[FOR <expL1>] | [FOR <expL1>] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[NOACTIONBAR] | [NOACTIONBAR] | ||
[NOAPPEND] | [NOAPPEND] | ||
− | |||
− | |||
[NODELETE] | [NODELETE] | ||
[NOEDIT | NOMODIFY] | [NOEDIT | NOMODIFY] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[STYLE <expC1>] | [STYLE <expC1>] | ||
− | |||
− | |||
[TITLE <expC2>] | [TITLE <expC2>] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==See Also== | ==See Also== | ||
Line 67: | Line 30: | ||
{| class="wikitable" width="100%" | {| class="wikitable" width="100%" | ||
!width="35%"|Keyword||Description | !width="35%"|Keyword||Description | ||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
|valign="top"|FIELDS <field list>||The comma-separated <field list> enables you to: specify the order in which the specified fields display and incorporate special handling options for each field. Please see below for these options. | |valign="top"|FIELDS <field list>||The comma-separated <field list> enables you to: specify the order in which the specified fields display and incorporate special handling options for each field. Please see below for these options. | ||
Line 88: | Line 47: | ||
[:H = <expC>] | [:H = <expC>] | ||
− | [:W = < | + | [:W = <expN>] |
Each field in the <field list> may be followed by special handling options. A delimiter precedes each option, either : or . | Each field in the <field list> may be followed by special handling options. A delimiter precedes each option, either : or . | ||
Line 99: | Line 58: | ||
|valign="top"|:B = <expr>,<expr> [:F]||Restricts valid data input to a range of values. The expressions specified must match the data type of the field and represent low <expr1> and high <expr1> values. The specified range is only enforced when the field value changes unless the :F option is used. | |valign="top"|:B = <expr>,<expr> [:F]||Restricts valid data input to a range of values. The expressions specified must match the data type of the field and represent low <expr1> and high <expr1> values. The specified range is only enforced when the field value changes unless the :F option is used. | ||
|- | |- | ||
− | |valign="top"|:C = <expC> | <@alias>,<expC>||The Choicelist option associates a | + | |valign="top"|:C = <expC> | <@alias>,<expC>||The Choicelist option associates a pulldown choicelist with a field. The choicelist may be either 'static': a string of comma-separated choices or 'dynamic': @alias,string or a SQL Select query. |
|- | |- | ||
|valign="top"|:V = <expL> [:E = <expC>] [:F]||Validates the field value based on the evaluation of <expL>. If <expL> returns true (.T.), the field value is considered valid. If <expL> returns false (.F.), the value is rejected and an error message displayed. If the :E option is specified, <expC> replaces the default error message. The validation is only enforced when the field value changes unless the :F option is used. | |valign="top"|:V = <expL> [:E = <expC>] [:F]||Validates the field value based on the evaluation of <expL>. If <expL> returns true (.T.), the field value is considered valid. If <expL> returns false (.F.), the value is rejected and an error message displayed. If the :E option is specified, <expC> replaces the default error message. The validation is only enforced when the field value changes unless the :F option is used. | ||
Line 105: | Line 64: | ||
|- | |- | ||
|valign="top"|:H = <expC>||Replaces the default field headings, field name or description, with the character expression <expC>. | |valign="top"|:H = <expC>||Replaces the default field headings, field name or description, with the character expression <expC>. | ||
− | |||
− | |||
|- | |- | ||
|valign="top"|:P = <expC>||Sets the picture format to <expC>. For more information on picture template characters and picture formatting, see @...GET. | |valign="top"|:P = <expC>||Sets the picture format to <expC>. For more information on picture template characters and picture formatting, see @...GET. | ||
|- | |- | ||
− | |valign="top"|:W = < | + | |valign="top"|:W = <expN>||Field is read-only when <expN> is greater than 0. |
|- | |- | ||
|} | |} | ||
− | |||
{| class="wikitable" width="100%" | {| class="wikitable" width="100%" | ||
Line 120: | Line 76: | ||
|- | |- | ||
|valign="top"|FOR <condition>||Restricts the BROWSE to those records matching the <condition>. | |valign="top"|FOR <condition>||Restricts the BROWSE to those records matching the <condition>. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
|valign="top"|NOACTIONBAR||Hides the actionbar at the bottom of the grid (from v3.1.0). | |valign="top"|NOACTIONBAR||Hides the actionbar at the bottom of the grid (from v3.1.0). | ||
|- | |- | ||
|valign="top"|NOAPPEND||Disables the appending of new records into the table. | |valign="top"|NOAPPEND||Disables the appending of new records into the table. | ||
− | |||
− | |||
|- | |- | ||
|valign="top"|NODELETE||valign=top|Disables record deletion. | |valign="top"|NODELETE||valign=top|Disables record deletion. | ||
|- | |- | ||
|valign="top"|NOEDIT | NOMODIFY||Disables record editing, providing read-only access to the table. | |valign="top"|NOEDIT | NOMODIFY||Disables record editing, providing read-only access to the table. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
|valign="top"|STYLE <expC1>||Specify the CSS style, <expC1>, to be used. | |valign="top"|STYLE <expC1>||Specify the CSS style, <expC1>, to be used. | ||
− | |||
− | |||
|- | |- | ||
|valign="top"|TITLE <expC2>||Specify a title, <expC2> to be displayed. | |valign="top"|TITLE <expC2>||Specify a title, <expC2> to be displayed. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
|} | |} | ||
Line 167: | Line 95: | ||
open database southwind | open database southwind | ||
use example | use example | ||
− | browse | + | browse fields title:c="Mr,Mrs,Ms",; |
− | + | last_name:w=1,; | |
− | + | first_name | |
+ | |||
+ | // Style keyword | ||
+ | open database southwind | ||
+ | use example | ||
+ | browse noactionbar ; | ||
+ | style "* { selection-color:yellow; ; | ||
+ | selection-background-color:black; ; | ||
+ | gridline-color:green; ; | ||
+ | background:black;color:yellow; ; | ||
+ | } ; | ||
+ | QTableView::item { background:lightgreen; } ; | ||
+ | QHeaderView::section { background-color:green;color:white;border:0px; } " | ||
</code> | </code> | ||
Revision as of 09:47, 12 October 2016
Contents
Purpose
Data grid
Syntax
BROWSE
[FIELDS <field list>]
[FOR <expL1>]
[NOACTIONBAR]
[NOAPPEND]
[NODELETE]
[NOEDIT | NOMODIFY]
[STYLE <expC1>]
[TITLE <expC2>]
See Also
Description
The BROWSE user-interface tool displays the records from the currently active table in a grid window.
Keyword | Description |
---|---|
FIELDS <field list> | The comma-separated <field list> enables you to: specify the order in which the specified fields display and incorporate special handling options for each field. Please see below for these options. |
<field> [:R]
[:B = <expr>, <expr> [:F]]
[:C = <expC> | <@alias>,<expC>]
[:V = <expL> [F:] [:E = <expC>]
[:P = <expC>]
[:H = <expC>]
[:W = <expN>]
Each field in the <field list> may be followed by special handling options. A delimiter precedes each option, either : or .
Option | Description |
---|---|
:R | Fields are read-only, so may be viewed, but not edited. |
:B = <expr>,<expr> [:F] | Restricts valid data input to a range of values. The expressions specified must match the data type of the field and represent low <expr1> and high <expr1> values. The specified range is only enforced when the field value changes unless the :F option is used. |
:C = <expC> | <@alias>,<expC> | The Choicelist option associates a pulldown choicelist with a field. The choicelist may be either 'static': a string of comma-separated choices or 'dynamic': @alias,string or a SQL Select query. |
:V = <expL> [:E = <expC>] [:F] | Validates the field value based on the evaluation of <expL>. If <expL> returns true (.T.), the field value is considered valid. If <expL> returns false (.F.), the value is rejected and an error message displayed. If the :E option is specified, <expC> replaces the default error message. The validation is only enforced when the field value changes unless the :F option is used.
This option does not work on memo fields. |
:H = <expC> | Replaces the default field headings, field name or description, with the character expression <expC>. |
:P = <expC> | Sets the picture format to <expC>. For more information on picture template characters and picture formatting, see @...GET. |
:W = <expN> | Field is read-only when <expN> is greater than 0. |
Keyword | Description |
---|---|
FOR <condition> | Restricts the BROWSE to those records matching the <condition>. |
NOACTIONBAR | Hides the actionbar at the bottom of the grid (from v3.1.0). |
NOAPPEND | Disables the appending of new records into the table. |
NODELETE | Disables record deletion. |
NOEDIT | NOMODIFY | Disables record editing, providing read-only access to the table. |
STYLE <expC1> | Specify the CSS style, <expC1>, to be used. |
TITLE <expC2> | Specify a title, <expC2> to be displayed. |
Example
open database southwind use example browse fields title:c="Mr,Mrs,Ms",; last_name:w=1,; first_name // Style keyword open database southwind use example browse noactionbar ; style "* { selection-color:yellow; ; selection-background-color:black; ; gridline-color:green; ; background:black;color:yellow; ; } ; QTableView::item { background:lightgreen; } ; QHeaderView::section { background-color:green;color:white;border:0px; } "