- 1 XML Attributes Description
- 2 GnListView Filtering
- 3 gn:data_columns_width
- 4 gn:data_columns_name
- 5 gn:data_columns_settings
- 6 gn:data_columns_id
- 7 gn:data_columns_type
- 8 gn:data_filters
- 9 gn:data_columns_sort
- 10 gn:lstRefreshNoFilter
- 11 gn:lstExpandToFitChildren
- Inherited classes
- Android class type
- Child elements
- Widget XML tag
GnListView is used to show data in a table appearance, with header on the top and data in rows with cells below.
XML Attributes Description
||Defines the width of each column from left to right that appears in listview|
||Defines the names from left to right that will appear in header columns|
||Defines the settings for each column from left to right that is displayed in listview|
||Defines column identifiers|
||Defines cell type for each row which will display data|
||Defines filter parameter to sort data|
||Defines column by which data will be sorted in |
||Defines that on refresh data will not be filtered (used only in special cases when business logic implementation is used)|
Once data is loaded from the database it can be filtered by a filter mechanism. You can also filter the data loaded into the
GnListView by using the following filter types:
Filters can also be chained by chain words:
If the filters are chained then each of filter statements has to be true in order to show some record that is in
The upper statement filters the
GnListView in the following way:
- IF the widget that has id
“@+id/widgetOne”has a value equal to the value in
columnOnein listview rows AND if
timestampvalue in listview rows is within today AND if
columnAnimalTypevalue in listview rows is equal to
“dog”, then the row from listview rows will be displayed in
- Based on upper example, the filter chaining definition is
[CHAIN WORD]|[FILTER],[CHAIN WORD]|[FILTER1]…
- General filter [FILTER] definition is
[VALUE] depending on the content of this field filters behave differently.
Value field special characters
||Defines range in VALUE (turns filter into RANGE filter) (not yet implemented)|
||Equivalent to like|
||Keyword identifier (turns filter into KEYWORD filter)|
In order to use special characters as standard text you need to escape them as follows:
Comparators define the relation between the two values that are being compared.
The following comparators can be used to compare:
|Comparator Symbol||Description||Value Types Allowed|
||Equals to values|
||Case sensitive equals to values|
||Greater than value|
Compares a value against value loaded into
GnListView data rows.
The definition of value filter is as follows :
The following filter will compare data row value if is equal to
two, filter will return
true and data row loaded into
[VALUE] field contains special character
@+id/ filter will behave as Widget filter.
Widget filter compares listview datarow value with value of a certain widget.
This filter checks if a widget with id
@+id/widgetOne has value equal to
columnA of listview datarow. If
true row will be shown.
Keyword filter compares values from list with special values that cannot be obtained by other means.
#today checks if value from listview is within today's date. If it is then it returns
true and row is displayed.
[#today]|[=]|[timestamp]is timestamp field within today's date
When using the timestamp the
date_time datatype has to be used.
Defines the width of each column from left to right that appears in listview
(String) values =
100 (percent) OR
When percentage values are used, the sum of all values must be 100
When DP values (density pixels) are used, the sum of values is irrelevant.
Defines the names from left to right that will appear in header columns
(String) values =
Defines the settings for each column from left to right that is displayed in listview.
If there is a single column to be shown in listview there is no separator between settings for columns.
If there are 2 or more columns whose settings should be configured “pipe” (
|) is used to separate them
format– converting long to human readable date and time, correct formats here
Defines column identifiers, which are directly related with
If the data is loading from a
dbRequest that has columns i.e.
name, surname, to read that data to listview your columns should have same id’s
surname, name. Note that the order here is not important.
Defines cell type for each row which will display data
(String) values =
||Shows text in cell|
||Shows pictures in cell|
||When pointer is used, additional widget attributes must be set|
||shows date as long, if |
||Shows all phone numbers stored in column of type |
Dt "pointer" additional widget attributes
- id of query which will be used to get pointed value
- name of table which will get queried
- column of referenced table which we would like to display supported referencing columns of data type
- query keys in case referenced table values need to be reduced. This optimises memory on large table loads. Permitted query keys are listed here.
Once data is loaded into
GnListView, it can be filtered by defining filter parameter.
Filters are separated by
, (comma symbol) and they have special syntax. More about filters here.
Defines column by which data will be sorted in
Currently, sorting only accepts ascending sort by
columnID defined by value of this attribute. For example if
dbRequest has columns:
name is set as a value for this attribute then all rows will be sorted ascending by name.
Defines that on refresh data will not be filtered (used only in special cases when business logic implementation is used)
This attribute is not relevant to designer and if developing a standard ginstr app then it can be omitted.
(Boolean) value =
Can be used only if listView is:
com.ginstr.widgets.internal.ExpandableHeightListView in control/widget_en_listview.xml, if set to
GnListView will stretch to load all children without scroll
(Boolean) value =