From wiki.ginstr.com
Revision as of 13:31, 30 August 2019 by Dinko (talk | contribs) (XML Attributes Description)
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

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