Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important information on the platform change.

HmiGuide_1-1677248501962.png

HowTo display content in a table

HmiGuide
Community Moderator
Community Moderator
History

27 Feb 2023 Update webIQ project for esier usage with PLC data exchange
24 Feb 2023 Initial release

Prerequisites
  • WebIQ Designer version 2.13 or higher (project is created with 2.13)
  • Basic knowledge of WebIQ Designer
  • Basic JavaScript know how
Introduction

In version 2.13 WebIQ does not provide a table control, but with the attached example you can easy create a table with content provided within string or structure arrays. This arrays can be filled e.g. by your PLC program. No deep JavaScript know how is necessary, to use the functions. Section "Use table functionality in your project " describe the step, for using the table functionality in your WebIQ project.

Helpful links

CSS table styler https://divtable.com/table-styler/
CSS selectors: https://www.w3schools.com/cssref/css_selectors.asp  https://developer.mozilla.org/en-US/docs/Web/CSS 
CSS
predefined colors: https://www.w3schools.com/cssref/css_colors.asp

Usage of demo project

The demo programme enables the table display of data stored in string and struct arrays.
In most cases, the data to be displayed is collected in the PLC and then copied into the array. In addition, the PLC programme must transmit the first and last array index to be displayed. In order for the project to work without a PLC, all data is displayed in WebIQ and can be edited. In a real project you would only display the table, but not the data for editing. Change the "Horizontal Alignment" (Left,Center,Richt,Strech ) of box-output for a different table alignment.

  1. Click buttons "Init Struct" and "Init Strings"
  2. Click buttons "Table Right", "Table Left" and "Table Big" for both sections: struct and strings to display table
  3. Change data to see change in table
  4. Click buttons "Table ..." to display changed data
  5. Change item "iRowLast" to update the table (to simulate a new value sent by PLC)

Screen shoot WebIQ table demo projectScreen shoot WebIQ table demo project

Use table functionality in your project

Right now, you have to create the following files in your project and copy the content via Copy & Paste from the demo project. For easy usage a WebIQ package, will be shipped until Q2 2023. This package will include dialog boxes (info,warning,error) table creating,...

Code Manager> Stylesheets> cssTable Css for table design.
Adapt the table design to your requirements. (color, font, padding, ...)
Code Manager> Local-Scripts> tableGenerators Contains functions to create tables.
See function headers for documentation
Code Manager> Local-Scripts> autoUpdateTable Autom. updates table when item iRowLast changes.
Adapt the item, to the items you are using in your project. Adapt digits for floats.
Insert this local script to the screen where you display the table.

All other files in the Code Manager, are only used for running the demo.

Requested features next version
  • Format functions (e.g. format numbers as date, time or leading "0" e.g. "003", Text lists)
  • Table header which is always visible (even when table spreads over multiple pages)
  • Table with controls to edit items
  • Create WebIQ table widget
Must Read
Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist