Skip to main content

Create a DataSource Table

  1. Navigate to HSYCO Manager

  2. Click on "Project Editor"

  1. Click "New Project"

  1. Give it a name ("todolistdatasource" for example)

  1. Click on "Create"

  1. Navigate to the homepage

  1. Click "add"

  1. Add a "Table"

  1. You can scale back the table if you want by dragging one of the corners

  1. Go back to "edit" mode

11. Now change the "Data Mode" from "uiset" to "datasource". This changes the way the table's data is populated.

12. Change also the "DataSource ID" to "db_todolist". This name is specified in the file under the /events folder inside the plugin folder

13. Click "Auto Config Columns" This, like the name suggests, populates the table's column with the data inside of the database

  1. Click "Yes"

  1. As you can see, the table columns are automatically populated

16. Select the "id" column and change the "hidden" field to "true". The "id" field is auto generated by the database so we don't need to insert it or to see it in viewmode

  1. Now select the "date" column

  1. Change the "Format" to "date"

  1. Change the "Field Type" to "date"

  1. Change the "Label" field to "YYYY/MM/DD"

  1. Select "time"

  1. Change the "Format" to "time"

  1. Change the "Field Type" to "time"

  1. Change the "Label" field to "HH:MM:SS"

  1. Click the "Info" field.

  1. Change the "Label" to "To Do"

  1. Click "ok" to save changes

  1. Now go into the attributes of the table and change the "edit mode" to "true"

  1. Click "4 Items..." to add the "edit" and "delete" button to the table

  1. Click "Add"

  1. Click "Edit Button"

  1. Click "Add"

  1. Click "Delete Button"

  1. Confirm by clicking "ok"

  1. The table object should look like this

Tip: Now we will add a button under the table to clear all the content in the table within a click!

  1. Click "add"

  1. Click "Button"

  1. Move the button in the lower-side of the page, under the table

  1. You can also align by clicking "Align"

  1. "Center Horizontally" to align horizontally

  1. Go to "edit" mode

  1. Change the "Label" to "Clear Table"

  1. Click this icon to change the icon

  1. Click the "Filter" field and search for "cancel"

  1. Select an icon and press "ok"

  1. Change the "Action" to "command"

  1. Change the "Name" to "cleardb"

  1. Lastly, change the "parameter" to "clear"

Tip: By changing the name and the parameter of the command, we can intercept it in our code and execute some action, like a query to the database to clear all the records

  1. The page should now look like this

  1. Save the project by clicking "Save"