View page - DataGrid

Home / Support / Administrators Guide / View page /

View page - DataGrid

1. Basic information

1.1. Description of the control

DataGrid is a view table that displays database records retrieved by a query from a database, with the possibility search and filtering records, and with the ability to export and import data.

1.2. Create a new control

A new datagrid can be created as follows from the preview page using the toolbar with controls:

  • First, clicking the mouse on the view page determines the position where the new datagrid should be placed. This will highlight the selected position with a gray horizontal line. Then just click on the “DataGrid” item in the toolbar of the view page, fill in the attributes of the new control in the newly opened dialog, and then save. This will insert a new datagrid at a pre-selected location on the view page.
  • If the desired position is not determined before inserting a new datagrid, the new datagrid will be inserted at the end of the view page.

1.3. Edit or delete a control

  • For each existing control, a pencil icon appears to the left of the control page to change or delete the control's settings.
  • Individual controls can be moved vertically on the view page using the Drag&Drop method. Moving consists of grabbing the control, preferably behind its name, and then dragging it to the desired location on the view page.
  • For security reasons, it is important to have the function of moving controls enabled using the “Drag&Drop” check box located above the toolbar with controls. This field is unchecked each time you log in to the application.

2. List of tabs in the control settings dialog

  • General – Setting general properties
  • View table – View table column settings
  • Details – Settings for columns displayed in details
  • Search – Search settings
  • Rights – Rights settings
  • Administration – Setting other properties

2.1. “General” tab

2.1.1. Common question

Obrázek.png

2.1.2. Name

  • The name of the control displayed in the header of the view table.
  • Placing the control name between the two bytes ensures that the view table is completely hidden if no record is the result of the query – for example “|Records in the Book table|”.
  • The right side can be followed by alternative HTML code, which will be displayed instead of the view table if no record is the result of the query – for example “|Records in the Book table|<img src="Images/Help.gif">”.

2.1.3. Dictionary

  • The dictionary lists the names of other controls, forms, view pages, categories, applications, and application groups used across the entire application.
  • The dictionary search is used to design the correct control name and to maintain the consistency of the nomenclature throughout the application so that controls with the same meaning located in different places in the application are named in the same way.

2.1.4. Width

  • The width of the control, expressed in pixels.
  • If this input field is not filled in, the width of the look-up table will be determined automatically by the web browser.

2.1.5. Data source

  • The data source defines the source database records displayed in the view table.
  • Data source settings are made in the graphical designer of database queries. A detailed description of the database query designer is provided in the separate “Database Query Designer” guide.

2.1.6. Options

  • Show the “New Record…” icon
    • Checking this box determines whether an icon should be displayed in the header of the view table, which redirects the user to a specific edit form in order to create a new record in the database.
  • Deny customization
    • Checking this box determines whether individual users should be disabled from changing the column settings of this view table.
  • Allow data import
    • Checking this box determines whether an icon should be displayed in the header of the view table, which will allow data to be imported into the displayed database table from format files.
      • XML
      • XLS(X) ( Excel)
      • CSV (Excel)
      • MDB (MS Access)
      • ZIP

Obrázek.png

  • Allow MS Excel Import
    • Checking this box determines whether an icon should be displayed in the header of the view table, which will allow the export and subsequent import of the displayed data in the view table into the database table using an XLS file.
    • This feature is only available for view tables that do not use joins.

Obrázek.png

Obrázek.png

  • Deny data export
    • Checking this box determines whether an icon should be displayed in the header of the view table, which will allow the export of displayed data from the view table to format files.
      • XLS(X) (Excel)
      • CSV (Excel)
      • DOC(X) (Word)
      • EML (Outlook Express)
      • HTML
      • TXT
      • SQL
      • PDF
      • C#
      • XML

Obrázek.png

  • Deny opening records
    • Checking this box determines whether all users should be denied access to the edit form to open the displayed database record using the pencil icon that appears at the beginning of each row of the view table.
  • Allow multiple assignments
    • Checking this box determines whether a text box or drop-down list with the selected value should be displayed in the view table instead of the control value itself, with the option to change the value without opening and editing the record in the edit form.
      • This function is applied only to controls that have the “Allow multiple assignments” check box selected on the “General” tab.
      • Multiple assignments can only be made by a logged-in user, a text box or a read-only drop-down list is displayed to an anonymous user.
    • Checking this box determines whether the “Assign value…” item should be available in the drop-down list of individual column filters, which is used to assign a value to all marked or filtered records in the view table.
      • This function is applied only to controls that have the “Allow multiple assignments” check box selected on the “Filters” tab.
      • Multiple assignments can only be made by a logged-in user.
      • If specific records are marked in the view table, only the selected records will be assigned a value. If no records are marked, all filtered records will be assigned a value.
    • Checking this box determines whether the “Delete records in view table” icon should be available in the view table header, which is used to delete marked or filtered records in the view table.
      • Users with administrator privileges – if specific records are marked in the view table, only the marked records will be deleted. If no records are marked, all filtered records will be deleted!
      • Users without administrator privileges can only delete marked specific records, they do not have permission to delete all filtered records.
    • Checking this box determines whether the “Mark records” icon should be available in the view table header, which is used to mark individual view table records in order to delete them or assign a value using a filter.
      • The list of marked records – primary key values (column “id”) separated by a semicolon – can be accessed using the variables “#datagrid1#”, “#datagrid2#”, “#datagrid3#”, etc. in the script. The index indicates the order of the view table on the view page.
  • Activate marking records
    • Checking this box determines whether a check box should be automatically displayed at the beginning of each row of the view table to mark a record in order to delete it or assign a value using a filter, without using the “Mark records” icon located in the view table header.
      • The list of marked records – primary key values (column “id”) separated by a semicolon – can be accessed using the variables “#datagrid1#”, “#datagrid2#”, “#datagrid3#”, etc. in the script. The index indicates the order of the view table on the view page.
  • Show sums of columns
    • Checking this box determines whether a row with the sum of the values of the individual columns should be displayed in the footer of the look-up table.
    • This function is applied only to TextBox controls of numeric data types that do not have the “Hide column total in view table” check box selected on the “General” tab.
  • Hide nested records
    • Checking this box determines whether the “PID = 0 or PID not defined” constraint should be automatically appended to the database query definition.

2.1.7. Aggregation query without grouping by date

Obrázek.png

  • Deny data export
    • Checking this box determines whether an icon should be displayed in the header of the view table, which will allow the displayed data from the view table to be exported to an XLS file.
  • Show sums of columns
    • Checking this box determines whether a row with the sum of the values of the individual columns should be displayed in the footer of the look-up table.
    • This function is applied only to columns that do not use the command to hide the sum of the column using the syntax “Column@-sum”. A detailed description of the syntax of column names is given in the separate “Administrator's Guide”.

2.1.8. Aggregation query with grouping by date

Obrázek.png

  • Deny data export
    • Checking this box determines whether an icon should be displayed in the header of the view table, which will allow the displayed data from the view table to be exported to an XLS file.
  • Fill time gaps
    • Checking this box determines whether time continuity should be ensured in the resulting data set in the column according to which the data is grouped. Where aggregated rows are missing, they will be automatically populated with all other columns set to “0”.
  • Pivot table
    • Checking this box determines whether a row with the sum of the values of the individual columns should be displayed in the footer of the look-up table.
    • This function is applied only to columns that do not use the command to hide the sum of the column using the syntax “Column@-sum”. A detailed description of the syntax of column names is given in the separate “Administrator's Guide”.
  • Show sums of columns
    • Checking this box determines whether the control itself should be displayed to the right of the previous one in the edit form, or whether it will be displayed below the previous control in the usual way.

2.2. “View table” tab

Obrázek.png

2.2.1. Options

  • Show upper navigation toolbar
    • Checking this box determines whether a toolbar with icons for switching between pages should be displayed in the header of the view table.
    • By default, this toolbar is displayed in the footer of each view table if the number of data displayed is greater than the number of records on the page.
  • Show filters
    • Checking this box determines whether the view table should allow filtering of database records.

2.2.2. Columns

  • Define the default settings of view table columns.

2.2.3. Records per page

  • For clarity, the look-up table uses the paging of the displayed records. This is useful in situations where the view table is retrieving large amounts of data.
  • The number of records per page determines the maximum number of records that appear on one page. You can easily switch between the individual pages using the toolbar, which is contained in each view table in its footer, or optionally in the header.

2.3. “Details” tab

Obrázek.png

2.3.1. Options

  • Show details
    • Checking this box determines whether the view table should display the details of each record at the bottom of the view table.
  • Show tooltip
    • Checking this box determines whether the view table should display the details of individual records in the tooltip when the mouse hovers over individual records.

2.3.2. Columns

  • Define the default settings for detail columns.

2.4. “Search” tab

Obrázek.png

2.4.1. Options

  • Activate search
    • Checking this box determines whether a row with a search box and a “Search” button should be automatically displayed in the header of the view table.
  • Optimized search
    • Checking this box determines whether each column of the view table should have its own search box.
  • Show search results only
    • Checking this box determines whether the data in the view table should be displayed only when entering a search term.

2.5. “Rights” tab

Obrázek.png

2.5.1. Rights

  • Rights define a list of user groups and users who have permission to display the control on the view page.

2.5.2. Replace rights to other controls

  • The “Replace rights to other controls” feature is used to unify rights across the entire view page for controls that are related in terms of rights.
  • Thanks to the “Show…” link, it is possible to display a list of all controls on the view page, including the setting of the rights of these controls. For each control, a check box is displayed that allows you to select the control. When you save a control, the same rights are then set for those selected controls.
  • An alternative for unifying rights within the entire view page is to display the report available from the “Rights of child objects” tab in the view page settings.

2.6. “Administration” tab

Obrázek.png

  • The “Administration” tab is only displayed for existing controls.

2.6.1. Template name

  • The template name is used to name the view table with the option to copy it when creating other view tables with the same source database table.
  • When creating a new view table, it is first necessary to define the data source using a database query, and then all available templates are available in the “Templates” drop-down list on the “General” tab. After selecting a template, all parameters of the view table will be automatically pre-filled with data from the selected template.
  • A list of all look-up tables that are marked as templates can be displayed using a report. A detailed description of the reports is given in a separate manual “Reports”.

2.6.2. Location

  • Select the view page on which the control is located.
  • The drop-down list contains all view pages located in the same application.

2.6.3. Change type to

  • The drop-down list offers the types of controls to which conversion of the control is supported.

3. Examples

3.1. Javascript functions

  • dg_Disable();
  • dg_Enable();
  • dg_HideColumn(DG123, 456);
  • dg_HideColumn(el(DG123), 456);
  • dg_HideHeader(DG123);
  • dg_SearchColumns(DG123, [1, 2, 3]);
  • dg_SearchColumns(el(DG123), [1, 2, 3]);
  • dg_ShowColumn(DG123, 456);
  • dg_ShowColumn(el(DG123), 456);
  • dg_VisibleColumns(DG123, [1, 2, 3]);
  • dg_VisibleColumns(el(DG123), [1, 2, 3]);
  • var array = dg_Controls(el(DG123));

3.2. Variables

  • #datagrid1#
  • #datagrid2#
  • #datagrid3#