Skip to content

Commit

Permalink
First setup
Browse files Browse the repository at this point in the history
  • Loading branch information
JelteMX committed Jan 20, 2020
0 parents commit 8406849
Show file tree
Hide file tree
Showing 46 changed files with 24,721 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const base = require("@mendix/pluggable-widgets-tools/configs/eslint.ts.base.json");

module.exports = {
...base,
rules: {
"@typescript-eslint/ban-ts-ignore": "warn",
"@typescript-eslint/no-empty-interface": "off",
"react/no-find-dom-node": "off",
"react/no-deprecated": "warn"
}
};
15 changes: 15 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
* text=auto
*.ts text eol=lf
*.tsx text eol=lf
*.js text eol=lf
*.jsx text eol=lf
*.css text eol=lf
*.scss text eol=lf
*.json text eol=lf
*.xml text eol=lf
*.md text eol=lf
*.gitattributes eol=lf
*.gitignore eol=lf
*.png binary
*.jpg binary
*.gif binary
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist/
node_modules/
*.log
.env
.vscode
.DS_Store
15 changes: 15 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
The Apache License v2.0

Copyright Jelte Lagendijk 2019

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
128 changes: 128 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
[![Build Status](https://travis-ci.org/JelteMX/mendix-dynamic-table.svg?branch=master)](https://travis-ci.org/JelteMX/mendix-dynamic-table)
[![Coverage Status](https://coveralls.io/repos/github/JelteMX/mendix-dynamic-table/badge.svg?branch=master)](https://coveralls.io/github/JelteMX/mendix-dynamic-table?branch=master)
[![Dependencies](https://david-dm.org/JelteMX/mendix-dynamic-table.svg)]([https://david-dm.org/JelteMX/mendix-dynamic-table](https://david-dm.org/JelteMX/mendix-dynamic-table))
[![DevDependencies](https://david-dm.org/JelteMX/mendix-dynamic-table/dev-status.svg)]([https://david-dm.org/JelteMX/mendix-dynamic-table?type=dev](https://david-dm.org/JelteMX/mendix-dynamic-table?type=dev))
[![Support](https://img.shields.io/badge/Support-Community%20(no%20active%20support)-orange.svg)](https://docs.mendix.com/developerportal/app-store/app-store-content-support)
[![Studio](https://img.shields.io/badge/Studio%20version-8.0%2B-blue.svg)](https://appstore.home.mendix.com/link/modeler/)
[![GitHub release](https://img.shields.io/github/release/JelteMX/mendix-dynamic-table)](https://github.com/JelteMX/mendix-dynamic-table/releases/latest)
[![GitHub issues](https://img.shields.io/github/issues/JelteMX/mendix-dynamic-table)](https://github.com/JelteMX/mendix-dynamic-table/issues)

## Dynamic (Tree) Table for Mendix

Mendix Dynamic (Tree) Table using [Ant Design Table](https://ant.design/components/table/) (MIT License). This is inspired on the [Tree Table widget](https://appstore.home.mendix.com/link/app/111095/), but takes objects in the columns as well.

![logo](/assets/AppStoreIcon.png)

Show a reference table. Rows & Columns are Mendix objects, Entry objects are in between.

![screenshot](/assets/screenshot.png)

> See test-project [https://dynamictabletest-sandbox.mxapps.io/](https://dynamictabletest-sandbox.mxapps.io/) for a live demo! On the bottom of this page there is a short explanation of the Domain model that is used.
> Missing features? See TODO at the bottom to see which items are still on the TODO list. If you find other bugs, please report this as an issue [here](https://github.com/JelteMX/mendix-dynamic-table/issues)
## Features

- Display a tree structure in a table
- Data Sources: XPath, Microflow, Nanoflow
- Children: Get over reference, Microflow, Nanoflow
- Selection of rows (single, multi)
- Events: Click/Double click on Row, Column, Entry or empty field

> This widget is about 850Kb uncompressed, so in your cloud deployment this widget should take about 220 Kb of network resources
Tested:

- IE11 & Edge
- Chrome
- Firefox
- Safari

## Basic Configuration

### 1. Row

![settings](/assets/settings1.png)

- Rows can be retrieved over XPath, Microflows and Nanoflows
- Your title can be purely text or HTML, either through the attribute or Nanoflow. Make sure you sanitize any user input to prevent XSS issues.

### 2. Row Children

![settings](/assets/settings2.png)

- This is totally optional. If you want to do a tree structure, please configure the children
- You can either get these over a Child reference (see bottom for explanation) or through a Microflow/Nanoflow when using a hasChildren attribute

### 3. Column

![settings](/assets/settings3.png)

- Columns can be retrieved over XPath, Microflows and Nanoflows
- Your title can be purely text or HTML, either through the attribute or Nanoflow. Make sure you sanitize any user input to prevent XSS issues.

### 4. Entries

![settings](/assets/settings4.png)

- An Entry is an object that is linked to 1 row and 1 column
- An Entry has a title (see Column/Row title, same principle)
- In order to retrieve entries, you will need to use a Data Helper (see next)

### 5. Data Helper

![settings](/assets/settings5.png)

- See explanation in the settings screen

### 6. Selection

![settings](/assets/settings6.png)

### 7. Events

![settings](/assets/settings7.png)

### 8. UI Settings

![settings](/assets/settings8.png)

## Demo project

[https://dynamictabletest-sandbox.mxapps.io/](https://dynamictabletest-sandbox.mxapps.io/)

### Domain Model

This demo uses the following domain model:

![domain model](/assets/domain-model.png)

Short explanation:

- A table is placed inside a data view with a `View` object
- For the first rows, it will get all `Rows` that have a reference to `View` and `_Root = true`
- Every row might have children. You either get these over a reference `Children`, or when you use a Microflow and `_hasChildren = true`
- `Column` Objects also have a reference to View, although it is not entirely necessary
- When loading `Entry` object, the widget will create a `EntryHelper` object that has references to the shown Rows&Columns. This helper is passed down to a microflow/nanoflow
- When the `Entry` objects are loaded, the widget will place these in the correct field based on the reference to a Column/Row
- The `SelectionHelper` is used for selections, but this is based on the test-project and can be disregarded here.

## Issues, suggestions and feature requests

Please report your issues [here](https://github.com/JelteMX/mendix-dynamic-table/issues)

## TODO

The following things need to be further tested and/or fixed. Please don't report this as a bug if this is in the TODO list:

- Basic WebModeler preview + settings
- Add Icon attribute (from Tree Table)
- Add config for when context changes (reload rows?)
- Column overflow (first column)
- Header height
- Left column lock issue with header. This is when locking the left column, it can get out of sync with the header.
- Unit tests

## License

Apache 2
Binary file added assets/AppStoreIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/domain-model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/settings1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/settings2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/settings3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/settings4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/settings5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/settings6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/settings7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/settings8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8406849

Please sign in to comment.