Your search did not match any results.
Toast

Overview

Documentation
The Toast is a widget that provides pop-up notifications. It can be displayed in one of the following modes: "info", "warning", "error", "success" and "custom". In this demo, the "success" and "error" modes are used depending on the context.
Copy to Codepen
Apply
Reset
window.onload = function() { var viewModel = { products: products, checkAvailable: function(data) { var type = data.value ? "success" : "error", productName = data.element.parent().find("#name").text(), text = productName + (data.value ? " is available" : " is not available"); DevExpress.ui.notify(text, type, 600); } }; ko.applyBindings(viewModel, document.getElementById("toast")); };
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <script src="js/jquery-3.1.0.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.4.0/knockout-min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/16.2.5/css/dx.spa.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/16.2.5/css/dx.common.css" /> <link rel="dx-theme" data-theme="generic.light" href="https://cdn3.devexpress.com/jslib/16.2.5/css/dx.light.css" /> <link rel="dx-theme" data-theme="android5.light" href="https://cdn3.devexpress.com/jslib/16.2.5/css/dx.android5.light.css" /> <link rel="dx-theme" data-theme="ios7.default" href="https://cdn3.devexpress.com/jslib/16.2.5/css/dx.ios7.default.css" /> <link rel="dx-theme" data-theme="win10.black" href="https://cdn3.devexpress.com/jslib/16.2.5/css/dx.win10.black.css" /> <link rel="dx-theme" data-theme="win10.white" href="https://cdn3.devexpress.com/jslib/16.2.5/css/dx.win10.white.css" /> <script src="https://cdn3.devexpress.com/jslib/16.2.5/js/dx.all.js"></script> <script src="data.js"></script> <link rel="stylesheet" type ="text/css" href ="styles.css" /> <script src="index.js"></script> </head> <body class="dx-viewport"> <div class="demo-container"> <div id="toast"> <h1>Product List</h1> <ul data-bind="foreach: products"> <li> <img data-bind="attr: { src: $data.ImageSrc }" > <div id="name" data-bind="text: $data.Name" ></div> <div data-bind="dxCheckBox: { text: 'Available', onValueChanged: $parent.checkAvailable }"></div> </li> </ul> </div> </div> </body> </html>
#toast { padding: 10px; } #toast ul { text-align: center; list-style-type: none; margin: 20px 0; } #toast ul li { display: inline-block; width: 160px; margin: 10px; } #toast ul li img { width: 100px; } .dx-toast-content { min-width: 300px; max-width: 400px; }
var products = [{ "ID": 4, "Name": "SuperLED 50", "Price": 1600, "Current_Inventory": 77, "Backorder": 0, "Manufacturing": 55, "Category": "Televisions", "ImageSrc": "../../../../images/products/4.png" }, { "ID": 5, "Name": "SuperLED 42", "Price": 1450, "Current_Inventory": 445, "Backorder": 0, "Manufacturing": 0, "Category": "Televisions", "ImageSrc": "../../../../images/products/5.png" }, { "ID": 6, "Name": "SuperLCD 55", "Price": 1350, "Current_Inventory": 345, "Backorder": 0, "Manufacturing": 5, "Category": "Televisions", "ImageSrc": "../../../../images/products/6.png" }, { "ID": 7, "Name": "SuperLCD 42", "Price": 1200, "Current_Inventory": 210, "Backorder": 0, "Manufacturing": 20, "Category": "Televisions", "ImageSrc": "../../../../images/products/7.png" }];