From wiki.ginstr.com
Revision as of 07:09, 13 October 2020 by Bojan (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

GnTableView

Widget XML tag
<com.ginstr.widgets.GnTableView>
Description
GnTableView is used to show data in an expanded table appearance, it replaces GnListView with gn:lstExpandToFitChildren="true"

XML Attributes Description

gn:data_filters{n} Defines filter parameter to sort data

Once data is loaded into GnTableView, it can be filtered by defining filter parameter.

Filters are separated by , (comma symbol) and they have special syntax. More about filters here.

gn:sortColumn Defines column by which data will be sorted

For example if dbRequest has columns: name,surname,timestamp, and name is set as a value for this attribute then all rows will be sorted by name and by defined sort order.

gn:sortOrder represents sorting order

Can be

  • hardcoded
    • regular - default
    • reverse
gn:rowXmlDefinition customised XML row layout

Can be

  • hardcoded - the name of xml file
gn:rowXmlDefinitionOdd(M103.8.0.5) customised XML row layout for odd rows. If not defined, gn:rowXmlDefinition will be used instead.

Can be

  • hardcoded - the name of xml file
gn:rowXmlDefinitionEven(M103.8.0.5) customised XML row layout for even rows. If not defined, gn:rowXmlDefinition will be used instead

Can be

  • hardcoded - the name of xml file
gn:updateRowsKeyColumn
optional

column ID which will pair rows that are incoming with rows that are already in TableView. ID column must contain only unique values. Attribute is used when update operation is performed to rows in TableView
Can be

  • hardcoded - the id of the column

Events

gn:act_setClick
gn:act_setLongClick
gn:event_onRowCreated

Data types

Input
rows
Output
rows

Example

<com.ginstr.widgets.GnTableView
  android:id="@+id/lstSite"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_gravity="center_horizontal"
  android:layout_marginLeft="20dp"
  android:layout_marginRight="20dp"
  android:background="#555555"
  gn:rowXmlDefinition="attendeeList_row.xml"
  gn:data_columns_sort="surname"
  gn:data_filters="[#today]|[=]|[timestamp]" />

Filtering

Same as GnListView Filtering