Last modified by MammaMia - 1 month ago
40 Views
1 min read

Displaying DataGrids in entity or widget view layouts

The data function provides a tabular view of entity records. This feature can also be used to create front-end editing capability by linking the data to a WPAS submit form.

Creating Data grids

Data grids are very useful to display entity records in a tabular format. Data grids provide more functionality compared to HTML forms. Users can sort, search, and export one or more records in different formats. WPAS data grids also offer a mobile view, ability to enable/disable user-selected columns, ajax based page navigation, and ability to create, update, and delete new records and more.

Datagrid tag function can be used to create advanced tabular displays without introducing complexity in entity or widget views

Function structure

!#datagrid['Unique Name','Default Attr List seperated by semicolon','Default Attr Labels seperated by semicolon','Grid Type','Entity Name','Relationship Name','Relationship Type','Create New Entity with Relationship Form Name',Create Relationship]#
view raw gistfile1.txt hosted with ❤ by GitHub

Function example

!#datagrid['tablerel2174','!#title#;!#featured_img#;!#ent_employee_email#;!#ent_employee_phone#;!#ent_employee_extension#;!#ent_employee_mobile#;!#tax_jobtitles#;!#entrelcon_from_manager#;!#entrelcon_from_executive_assistant#;!#entrelcon_employees_locations#;!#entrelcon_employees_departments#','Employee;Photo;Email;Phone;Extension;Mobile;Job Title;Manager;Assistant;Location;Department','R','emd_employee','!#entrelcon_to_manager#','connected','',1]#
view raw gistfile1.txt hosted with ❤ by GitHub

  • Unique Name: An identifier which uniquely identifies this data grid.
  • Default Attr List separated by a semicolon: The semicolon-separated list of attribute tags which will make up the value of this data grid.
  • Default Attr Labels separated by a semicolon: The semicolon-separated list of attribute labels which will make up the column headers of this data grid
  • Grid Type: The type grid which will be created. The default is R.
  • Entity Name: The name of the main entity where the metadata comes from.
  • Relationship Name: Set the relationship name if you want to use this data grid to create connections from the main entity to other entities. Leave it '' if not.
  • Relationship Type: For con-relation, set it connected. For rel-relation, set it related.
  • Create a New Entity with Relationship Form Name: Set the name of the submission form which will be used to create the main entity record. When set, the "Add New button" is displayed.
  • Create Relationship: Set 0 for creating new relationship records using the submit form. Set 1 if you want to allow users to create relationships of only existing records.
Image Gallery
Was this information helpful?