How to use the cx/widgets.Toast.create function in cx

To help you get started, we’ve selected a few cx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github codaxy / tdo / app / routes / board / Controller.js View on Github external
batchUpdatesAndNotify(() => {
            taskTracker.update(task.id, {
                deleted: true,
                deletedDate: new Date().toISOString()
            }, { suppressUpdate: true });
            taskTracker.reorderList(task.listId, true);
            refreshTasks();
        }, () => {
            if (nextTask) {
                activateTask(nextTask.id);
                console.log(nextTask);
            }
        });

        Toast.create({
            mod: 'warning',
            timeout: 4000,
            items: (
                
                    <div>
                        </div>
                
            )
        }).open();
    }
github codaxy / dashboards / app / routes / default / index.js View on Github external
children:
                    "Error occurred while loading dashboard: " + error.toString(),
                    timeout: 10000,
                    mod: "error"
                }).open();
                console.log(error);
                History.pushState({}, null, "~/");
            } else {
                this.store.set("$page.dashboard", {
                    width: 80,
                    height: 40,
                    ...w
                });
                if (!isNonEmptyArray(w.widgets)) {
                    if (this.store.set('$page.add', true)) {
                        Toast.create({
                            children: 'Drag & drop widgets from the right sidebar on the board.',
                            timeout: 5000,
                            mod: "primary"
                        }).open();
                    }
                }
            }
        });
github codaxy / dashboards / app / routes / sign-in / Controller.js View on Github external
.catch(error => {
				let errorCode = error.code;
				let errorMessage = error.message;
				let toast = Toast.create({
					message: `Login failed with error code ${errorCode}. ${errorMessage}`,
					timeout: 15000,
					mod: "error"
				});
				toast.open(this.store);
			});
	}
github codaxy / tdo / app / routes / Controller.js View on Github external
onDeleteBoard(e, { store }) {
            let board = store.get("$board");
            boardTracker.update(board.id, {
                deleted: true,
                deletedDate: new Date().toISOString(),
                edit: false
            }, { suppressUpdate: true });
            boardTracker.reorder(true);
            boardTracker.forceUpdate();
            let boards = boardTracker.getActiveBoards();
            History.pushState({}, null, boards.length &gt; 0 ? "~/b/" + boards[0].id : "~/")

            Toast.create({
                mod: 'warning',
                timeout: 3000,
                items: (
                    
                        <div>
                            </div>
                    
                )
            }).open();
        },