jqwidgets-framework
Version:
jQWidgets is an advanced Angular, Vue, Blazor, React, Web Components, jquery, ASP .NET MVC, Custom Elements and HTML5 UI framework.
118 lines (108 loc) • 6.51 kB
HTML
<html lang="en">
<head>
<title id='Description'>Kanban Add, Remove, Update Items</title>
<meta name="description" content="jQuery Kanban. Adding, Removing and Updating Items." />
<link rel="stylesheet" href="../../../jqwidgets/styles/jqx.base.css" type="text/css" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1 minimum-scale=1" />
<script type="text/javascript" src="../../../scripts/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxdata.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxsortable.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxkanban.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxexpander.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxinput.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxcolorpicker.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxradiobutton.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxdropdownbutton.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript" src="../../../scripts/demos.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var fields = [
{ name: "id", type: "string" },
{ name: "status", map: "state", type: "string" },
{ name: "text", map: "label", type: "string" },
{ name: "tags", type: "string" },
{ name: "color", map: "hex", type: "string" },
{ name: "resourceId", type: "number" }
];
var source =
{
localData: [
{ id: "1161", state: "new", label: "Combine Orders", tags: "orders, combine", hex: "#5dc3f0", resourceId: 3 },
{ id: "1645", state: "work", label: "Change Billing Address", tags: "billing", hex: "#f19b60", resourceId: 1 },
{ id: "9213", state: "new", label: "One item added to the cart", tags: "cart", hex: "#5dc3f0", resourceId: 3 },
{ id: "6546", state: "done", label: "Edit Item Price", tags: "price, edit", hex: "#5dc3f0", resourceId: 4 },
{ id: "9034", state: "new", label: "Login 404 issue", tags: "issue, login", hex: "#6bbd49" }
],
dataType: "array",
dataFields: fields
};
var dataAdapter = new $.jqx.dataAdapter(source);
var resourcesAdapterFunc = function () {
var resourcesSource =
{
localData: [
{ id: 0, name: "No name", image: "../../../jqwidgets/styles/images/common.png", common: true },
{ id: 1, name: "Andrew Fuller", image: "../../../images/andrew.png" },
{ id: 2, name: "Janet Leverling", image: "../../../images/janet.png" },
{ id: 3, name: "Steven Buchanan", image: "../../../images/steven.png" },
{ id: 4, name: "Nancy Davolio", image: "../../../images/nancy.png" },
{ id: 5, name: "Michael Buchanan", image: "../../../images/Michael.png" },
{ id: 6, name: "Margaret Buchanan", image: "../../../images/margaret.png" },
{ id: 7, name: "Robert Buchanan", image: "../../../images/robert.png" },
{ id: 8, name: "Laura Buchanan", image: "../../../images/Laura.png" },
{ id: 9, name: "Laura Buchanan", image: "../../../images/Anne.png" }
],
dataType: "array",
dataFields: [
{ name: "id", type: "number" },
{ name: "name", type: "string" },
{ name: "image", type: "string" },
{ name: "common", type: "boolean" }
]
};
var resourcesDataAdapter = new $.jqx.dataAdapter(resourcesSource);
return resourcesDataAdapter;
}
$('#kanban').jqxKanban({
width: getWidth('kanban'),
height: 500,
resources: resourcesAdapterFunc(),
source: dataAdapter,
columns: [
{ text: "Backlog", dataField: "new", maxItems: 5 },
{ text: "In Progress", dataField: "work", maxItems: 5 },
{ text: "Done", dataField: "done", maxItems: 5, collapseDirection: "right" }
]
});
$("#updateItem, #removeItem, #addItem").jqxButton();
$("#updateItem").click(function () {
$('#kanban').jqxKanban('updateItem', "1161", { status: "new", text: "Task", tags: "task", color: "#5dc3f0", resourceId: 3 });
$("#updateItem").jqxButton({ disabled: true });
});
var newItemsCount = 0;
$("#addItem").click(function () {
$('#kanban').jqxKanban('addItem', { status: "new", text: "Task" + newItemsCount, tags: "task" + newItemsCount, color: "#5dc3f0" });
newItemsCount++;
});
$("#removeItem").click(function () {
$('#kanban').jqxKanban('removeItem', "1645");
$("#removeItem").jqxButton({ disabled: true });
});
});
</script>
</head>
<body>
<div id="kanban"></div>
<br />
<button id="addItem">Add Item</button>
<button id="removeItem">Remove Item</button>
<button id="updateItem">Update Item</button>
<div style="position: absolute; bottom: 5px; right: 5px;">
<a href="https://www.jqwidgets.com/" alt="https://www.jqwidgets.com/"><img alt="https://www.jqwidgets.com/" title="https://www.jqwidgets.com/" src="https://www.jqwidgets.com/wp-content/design/i/logo-jqwidgets.png"/></a>
</div>
</body>
</html>