[default.html]
<script type="text/javascript">
var kbnCollapseCollec=retrivedCollec=kbnSlCollapseCollec=retrivedSlCollec= [];
$(function() {
var data = ej.DataManager(window.kanbanData).executeLocal(ej.Query().take(50));
$("#Kanban").ejKanban(
{
dataSource: data,
isResponsive: true,
allowToggleColumn: true,
columns: [
{ headerText: "Backlog", key: "Open" },
{ headerText: "In Progress", key: "InProgress" },
{ headerText: "Testing", key: "Testing" },
{ headerText: "Done", key: "Close" }
],
keyField: "Status",
allowTitle: true,
fields:{
primaryKey: "Id",
swimlaneKey: "Assignee",
content: "Summary"
},
allowSelection: false,
swimlaneSettings:{
allowDragAndDrop: true,
},
//Here you can use the create event
create: function (args) {
var kbnObj = $('#Kanban').data('ejKanban')
retrivedCollec = JSON.parse(sessionStorage.getItem("kbnCollapseCollec"));
if (!retrivedCollec) return;
for (var i = 0; i < retrivedCollec.length; i++)
kbnObj.toggleColumn(retrivedCollec[i]);
retrivedSlCollec = JSON.parse(sessionStorage.getItem("kbnSlCollapseCollec"));
if (!retrivedSlCollec) return;
for (var i = 0; i < retrivedSlCollec.length; i++)
kbnObj.KanbanSwimlane.toggle($(".e-slexpandcollapse").eq(retrivedSlCollec[i]));
}
});
//Here you can use the swimlane expand and collapse
var slexpandcollaspe = $("#Kanban").find(".e-slexpandcollapse .e-icon");
slexpandcollaspe.click(function (args) {
if (slexpandcollaspe.hasClass("e-slexpand") || slexpandcollaspe.hasClass("e-slcollapse")) {
var value = $('#Kanban .e-swimlanerow').index($(args.target).parents(".e-swimlanerow"));
if (sessionStorage.getItem("kbnSlCollapseCollec") == '' || ej.isNullOrUndefined(sessionStorage.getItem("kbnSlCollapseCollec")) )
var kbnSlCollapseCollec = [];
else
var kbnSlCollapseCollec = JSON.parse(sessionStorage.getItem("kbnSlCollapseCollec"));
kbnSlCollapseCollec.push(value);
sessionStorage.setItem("kbnSlCollapseCollec", JSON.stringify(kbnSlCollapseCollec));
}
});
//Here you can use the column expand and collapse
var clexpandcollaspe = $("#Kanban").find(".e-headercell .e-icon");
clexpandcollaspe.click(function (args) {
var value = $(args.target).parents(".e-headercell").find('.e-headerdiv').text();
if (clexpandcollaspe.hasClass("e-clexpand") || clexpandcollaspe.hasClass("e-clcollapse")) {
var value = $(args.target).parents(".e-headercell").find('.e-headerdiv').text();
if (sessionStorage.getItem("kbnCollapseCollec") == '' || ej.isNullOrUndefined(sessionStorage.getItem("kbnCollapseCollec")) )
var kbnCollapseCollec = [];
else
var kbnCollapseCollec = JSON.parse(sessionStorage.getItem("kbnCollapseCollec"));
kbnCollapseCollec.push(value);
sessionStorage.setItem("kbnCollapseCollec", JSON.stringify(kbnCollapseCollec));
}
});
});
</script> |
[default.html]
create: function (args) {
// Create object for Kanban control
var kbnObj = $('#Kanban').data('ejKanban')
// Extend toggleColumnByKey public method with key
kbnObj.toggleColumnByKey = function (key) {
// Get columns property
var columns = kbnObj.model.columns;
for (var i = 0; i < columns.length; i++) {
// Check key values
if (columns[i]["key"] == key)
// Pass header text for specified key value to toggleColumn public method
kbnObj.toggleColumn(columns[i]["headerText"]);
}
}
………………………………….
|
[default.html]
clexpandcollaspe.click(function (args) {
var kbnObj = $('#Kanban').data('ejKanban')
var columns = kbnObj.model.columns;
var value = $(args.target).parents(".e-headercell").find('.e-headerdiv').text(),keyValue;
……………… //Here you can push the key values
if ($.inArray(value, kbnCollapseCollec) == -1)
kbnCollapseCollec.push(keyValue);
debugger;
sessionStorage.setItem("kbnCollapseCollec", JSON.stringify(kbnCollapseCollec));
}
});
……………… |
[default.html]
…………….
function headerClick(args) {
keyValue = args.columnData.key; //Here you can get the key values
}
………….. |