Workflows

This demos shows how to use DataViewsJS and simple grouping to implement a workflow for objectives, allowing the user to check specific tasks in order to move them to the next status

Workflows can help eliminate repetitive tasks and focus on what matters most. This demos shows how to use DataViewsJS and simple grouping to implement a workflow for objectives, allowing the user to check specific tasks in order to move them to the next status.
<!DOCTYPE html> <html lang="en"> <head> <base href="/dataviewsjs/demos/en/sample/Showcase/Workflows/purejs/" /> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="keywords" content="custom presenters, custom headers" /> <meta name="description" content="This demos shows how to use DataViewsJS and simple grouping to implement a workflow for objectives, allowing the user to check specific tasks in order to move them to the next status" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Workflows | Showcase | MESCIUS DataViewsJS JavaScript Demos</title> <link href="/dataviewsjs/demos/node_modules/normalize.css/normalize.css" rel="stylesheet" type="text/css" /> <link href="/dataviewsjs/demos/static/css/base.css" rel="stylesheet" type="text/css" /> <link href="/dataviewsjs/demos/node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css" /> <link href="/dataviewsjs/demos/static/dataviews/gc.dataviews.core.min.css" rel="stylesheet" type="text/css" /> <link href="/dataviewsjs/demos/static/dataviews/gc.dataviews.grid.min.css" rel="stylesheet" type="text/css" /> <link href="styles.css" rel="stylesheet" type="text/css" /> <script src="/dataviewsjs/demos/static/js/app-polyfills.min.js" type="text/javascript"></script> <script type="text/javascript"> window.process = { env: { NODE_ENV: 'production', USE_NPM: false, USE_CDN: false, SITE_ROOT: '/dataviewsjs/demos', FRAMEWORK: 'purejs', DVJS_LICENSE_KEY: 'E348418822993781#B0EWvwY4dNNVQqJHUDpFROVWe5ZWNYFlVQFmRsJWRht4Z6lDO4Vla7YUaXhEWxd7Z5YXMuRnY7tWTQRHSlVnaYlXNhlEOpdkZ0FHWYJ5QKd6VXN5aR3ieGhUav9kZTBXWahkYBhEVutmZ72CbjdlZvV5TVdGdiplQsZXe95kUmNmZVF5cJ3mcypWNyx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XROVGbLJkcTNGRzIER8tmd4YGNhh7dxAnMvIHRv46VtBXS4U5KvJ6dZJ6M5p4TxIjd9I5QSpXTTV6SDZXb7lzaL56ZiojITJCLikTQxUTQFV4NiojIIJCLyETO7UzM7kTO0IicfJye&amp;Qf35VfikkR9IkI0IyQiwiIyEjL6ByUKBCZhVmcwNlI0IiTis7W0ICZyBlIsISNwkTN6ADI8EDMxMjMwIjI0ICdyNkIsIyc59yc5l6YzVWbuoCLwpmLzVXajNXZt9iKs2WauMXdpN6cl5mLqwSbvNmLzVXajNXZt9iKsAnau26YuMXdpN6cl5mLqwSbvNmL6VGZ9RXajVGchJ7ZuoCLuNmLt36YukHdpNWZwFmcn9iKs46bj9Se4l6YlBXYydmLqwicr9ybj9Se4l6YlBXYydmLqwCcq9ybj9Se4l6YlBXYydmLqIiOiMXbEJCLiMVVJN4UF5kI0ISYONkIsUWdyRnOiwmdFJCLiYzMyUjNxIDNxUDO5gTM5IiOiQWSiwSfdtlOicGbmJCLlNHbhZmOiI7ckJye0ICbuFkI1pjIEJCLi4TPRtGOhtWWEFWd4IDOLRVRvx4SyMGcDhTW6n4ep', }, }; </script> <script src="/dataviewsjs/demos/static/dataviews/gc.dataviews.common.min.js" type="text/javascript"></script> <script src="/dataviewsjs/demos/static/dataviews/gc.dataviews.core.min.js" type="text/javascript"></script> <script src="/dataviewsjs/demos/static/dataviews/gc.dataviews.grid.min.js" type="text/javascript"></script> <script src="/dataviewsjs/demos/static/js/license.js" type="text/javascript"></script> </head> <body class="theme-default"> <noscript>You need to enable JavaScript to run this app.</noscript> <div class="main-container"> <div id="grid"></div> </div> <script src="data.js" type="text/javascript"></script> <script src="app.js" type="text/javascript"></script> </body> </html>
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError( 'Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.' ); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === 'string') return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === 'Object' && o.constructor) n = o.constructor.name; if (n === 'Map' || n === 'Set') return Array.from(o); if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== 'undefined' && Symbol.iterator in Object(iter)) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } // presenters var userPicPresenter = '<img class="pic" title="{{=it.assignee}}" src="{{=it.assigneeImage}}" />'; var taskPresenter = '\n <span class="icon {{?it.completed}}icon-checked{{?}} fa fa-check" onclick="completeTask(\'{{=it.id}}\')"></span>\n <span class="label">{{=it.task}}</span>\n'; var cols = [ { id: 'task', caption: 'Task', dataField: 'task', width: '*', presenter: taskPresenter, }, { id: 'dueDate', caption: 'Due Date', dataField: 'dueDate', align: 'right', width: 120, }, { id: 'assigneeImage', caption: 'Assignee', dataField: 'assigneeImage', presenter: userPicPresenter, width: 54, }, { id: 'assignee', caption: 'Assignee', dataField: 'assignee', visible: false, }, { id: 'completed', caption: 'Completed', dataField: 'completed', visible: false, }, ]; // clone data var demoData = _toConsumableArray(data); // layout var layout = new GC.DataViews.GridLayout({ allowSorting: false, allowGrouping: false, allowColumnReorder: false, allowColumnResize: false, rowHeight: 44, showColHeader: false, showRowHeader: false, selectionMode: 'none', grouping: [ { field: 'name', header: { height: 56, template: '<div class="group"><span>{{=it.name}}</span></div>', }, footer: { visible: false, }, collapsed: false, }, ], }); var dataView = new GC.DataViews.DataView(document.getElementById('grid'), demoData, cols, layout); // focus data.view by default document.getElementById('grid').focus(); // event handlers window.completeTask = function (id) { var dataViewItems = dataView.data.getItems(); var item = dataViewItems.find(function (entry) { return entry.id === id; }); if (item) { var original = data.find(function (t) { return t.id === id; }); dataView.data.updateItem( item.sourceIndex, Object.assign({}, item.dataItem, { name: item.completed ? original.name : 'Completed', completed: !item.completed, }) ); } };
var data = [ { id: '001', name: 'Standing agenda', task: 'Review pipeline', assignee: 'Rose C Engstrom', assigneeImage: 'https://i.pravatar.cc/32?img=1', dueDate: 'Tomorrow', completed: false, }, { id: '002', name: 'Standing agenda', task: 'Approved budget', assignee: 'Rose C Engstrom', assigneeImage: 'https://i.pravatar.cc/32?img=2', dueDate: 'Tomorrow', completed: false, }, { id: '003', name: 'Review revenue', task: 'Media plan', assignee: 'Andrew Y Forbis', assigneeImage: 'https://i.pravatar.cc/32?img=3', dueDate: 'Tomorrow', completed: false, }, { id: '004', name: 'Review revenue', task: 'Overall goals and success metrics', assignee: 'Andrew Y Forbis', assigneeImage: 'https://i.pravatar.cc/32?img=4', dueDate: 'Tomorrow', completed: false, }, { id: '005', name: 'New topics', task: 'Customizable sales deck template', assignee: 'Pamela R Gardner', assigneeImage: 'https://i.pravatar.cc/32?img=5', dueDate: 'Tomorrow', completed: false, }, { id: '006', name: 'New topics', task: 'New messaging framework', assignee: 'James S Dock', assigneeImage: 'https://i.pravatar.cc/32?img=6', dueDate: 'Tomorrow', completed: false, }, { id: '007', name: 'New topics', task: 'Team awards', assignee: 'Douglas I Graham', assigneeImage: 'https://i.pravatar.cc/32?img=7', dueDate: 'Tomorrow', completed: false, }, { id: '008', name: 'Follow up', task: 'Prepare SAM numbers', assignee: 'Caroline T Decaro', assigneeImage: 'https://i.pravatar.cc/32?img=8', dueDate: 'Friday', completed: false, }, { id: '009', name: 'Follow up', task: 'Discuss candidates for Sales Manager', assignee: 'Viola M Rosa', assigneeImage: 'https://i.pravatar.cc/32?img=9', dueDate: 'May 28', completed: false, }, { id: '010', name: 'Follow up', task: 'Job analysis of sales representative', assignee: 'Dennis J Butler', assigneeImage: 'https://i.pravatar.cc/32?img=10', dueDate: 'April 12', completed: false, }, ];
.main-container { overflow: hidden; height: 100%; } .wrapper { position: relative; height: 100%; } .grid-container { height: 100%; } .grid-container #grid { height: 100%; } .gc-viewport { box-sizing: border-box; } .gc-group-header-row.gc-row { display: flex; align-items: center; flex-direction: row; } .gc-row { display: flex; align-items: center; flex-direction: row; } .gc-group-header-row { background-color: transparent; color: inherit; border-bottom: 2px solid; align-items: flex-end; } .gc-cell-border { border-right: transparent; } .gc-cell { padding: 6px 10px; display: inherit !important; } .pic { width: 32px; height: 32px; display: block; border-radius: 50%; } .group { font-size: 1.5rem; font-weight: 600; margin-left: 10px; margin-bottom: 0; } .icon { color: grey; border-radius: 50%; width: 24px; height: 24px; border: 1px solid rgba(0, 0, 0, 0.25); display: inline-flex; align-items: center; justify-content: center; margin-right: 0.75em; cursor: pointer; } .icon:hover { border-color: #2e69dc; color: #2e69dc; } .icon.icon-checked { background-color: #25e8c8; border-color: transparent; color: white; } .icon.icon-checked:hover { background-color: #28ceb2; } /*# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNob3djYXNlL1dvcmtmbG93cy9wdXJlanMvc3R5bGVzLnNjc3MiLCJTaG93Y2FzZS9Xb3JrZmxvd3MvcHVyZWpzL3N0eWxlcy5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxnQkFBQTtFQUNBLFlBQUE7QUNDRjs7QURFQTtFQUNFLGtCQUFBO0VBQ0EsWUFBQTtBQ0NGOztBREVBO0VBQ0UsWUFBQTtBQ0NGO0FEQ0U7RUFDRSxZQUFBO0FDQ0o7O0FER0E7RUFDRSxzQkFBQTtBQ0FGOztBREdBO0VBQ0UsYUFBQTtFQUNBLG1CQUFBO0VBQ0EsbUJBQUE7QUNBRjs7QURHQTtFQUNFLGFBQUE7RUFDQSxtQkFBQTtFQUNBLG1CQUFBO0FDQUY7O0FER0E7RUFDRSw2QkFBQTtF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