Kanban JAVASCRIPT UI Component API

Kanban Javascript API

Class

Kanban

Kanban represents a kanban board that visually depicts work at various stages of a process using cards to represent tasks and columns to represent each stage of the process.

Selector

smart-kanban

Properties

AallowColumnReorderEnables or disables column reordering. When this property is set to true and allowDrag is enabled, users will be able to reoder columns through drag & drop. For example: Click and drag the first column's header and drop it over another column.
AallowColumnEditEnables or disables column editing. When this property is set to true, users will be able to dynamically change the column's header label by double clicking on it.
AallowColumnRemoveEnables or disables column removing. When this property is set to true, users will be able to dynamically remove a column through the column actions menu. the 'columnActions' property should be true.
AallowColumnHideEnables or disables column hiding. When this property is set to true, users will be able to dynamically hide a column through the column actions menu. the 'columnActions' property should be true.
AaddNewButtonToggles the visibility of the column buttons for adding tasks. A particular button can be disabled by setting addNewButton in the column's definition to false.
AaddNewButtonDisplayModeDetermines whether the add button is visible in the column header and/or after the tasks in the column.
AaddNewColumnSets or gets whether a column with a button for adding new status columns to the Kanban will be displayed.
AaddNewColumnWidthSets the width of the add new column. The property is used, if the 'columnWidth' property is set, too. It specifies the width of the dynamic new column.
AallowDragAllows the dragging of tasks.
AallowDropAllows the dropping of tasks.
AallowDropPlaceholderAllows the dropping of tasks placeholder. When you drag a task over another task it will make an empty space for the task.
AapplyColumnColorToTasksThis property changes the visual appeal of the Kanban columns and tasks. When set to true and the Kanban columns have their 'color' property set, the color is also applied to the tasks and edit dialog.
AautoLoadStateEnables or disables auto load state from the browser's localStorage. Information about tasks and their position and selected state, filtering, sorting, collapsed columns, as well as the values of the properties taskActions, taskComments, taskDue, taskPriority, taskProgress, taskTags, and taskUserIcon is loaded.
AautoSaveStateEnables or disables auto save state to the browser's localStorage. Information about tasks and their position and selected state, filtering, sorting, collapsed columns, as well as the values of the properties taskActions, taskComments, taskDue, taskPriority, taskProgress, taskTags, and taskUserIcon is saved.
AautoColumnHeightAutomatically updates the columns height depending on the tasks inside the column. The effect of this property is observed when 'columnColorEntireSurface' is true.
CcollapsibleAllows collapsing the card content.
CcolumnColorsDisplays colors in the column header, when the column's color property is set.
CcolumnWidthSets the Kanban columns width. When this property is set, the kanban columns width is set and a horizontal scrollbar may appear.
CcolumnColorEntireSurfaceDisplays background in the Kanban column.
CcolumnFooterDisplays a column footer which shows the summary of the column.
CcolumnsDescribes the columns properties. Click for more details. Property object's options:
  • addNewButton:boolean - Sets or gets whether the column's button for adding tasks is visible. Works in conjunction with the Kanban property of the same name.
  • allowRemove:boolean - Sets or gets whether the column can be removed from the column menu.
  • collapsed:boolean - Sets or gets whether the column is collapsed.
  • collapsible:boolean - Sets or gets whether the column is collapsible. Works in conjunction with the Kanban property of the same name.
  • columns:{ addNewButton?: boolean, collapsed?: string, collapsible?: string, columns?: [], dataField?: string, label?: string, orientation?: string, selected?: string }[] - Sets or gets the column's sub-columns. Sub-columns has the same properties as top-level columns.
  • dataField:string - Sets or gets the column's data source bound field. Corresponds to the status field in the data source.
  • label:string - Sets or gets the text displayed in the column's header.
  • editable:boolean - Sets or gets whether a column is editable.
  • visible:boolean - Sets or gets whether a column is visible.
  • reorder:boolean - Sets or gets whether a column can be reordered.
  • orientation:string - Sets or gets whether the tasks in the column flow vertically or horizontally.
  • selected:boolean - Sets or gets whether the column is selected. Only applicable to sub-columns when hierarchy is 'tabs'.
  • headerTemplate:any - Determines whether a column header has a template. You can pass 'string', 'function' or HTMLTemplateElement as a value.
  • width:number | null - Sets the Kanban column width. When this property is set, the kanban column width is set and a horizontal scrollbar may appear.
CcolumnActionsToggles the visibility of the column actions icon.
CcolumnSummaryDetermines whether task count information is displayed in column headers.
CcolumnHeaderTemplateDetermines whether a column header has a template. You can pass 'string', 'function' or HTMLTemplateElement as a value.
CcolumnEditModeDetermines the column edit behavior. With the 'header' option, edit starts on double click on the column's label. In 'menu' mode, edit is allowed from the 'columnActions' menu. In 'headerAndMenu' option, column editing includes both options.
CcurrentUserSets or gets the id of the current user. Has to correspond to the id of an item from the users property/array. Depending on the current user, different privileges are enabled. If no current user is set, privileges depend on the element's properties.
DdisableDialogSets or gets whether the default dialog for adding/removing tasks or comments is disabled.
DdialogCustomizationFunctionSets or gets a customization function for the dialog. This function can be used to customize the dialog look or to replace it. The Kanban calls this function with 5 arguments - 'dialog', 'taskOrComment', 'editors', 'purpose' and 'type'. The dialog is the 'smart-window' instance used as a default Kanban dialog. 'taskOrComment' is object which could be Kanban task or comment. 'purpose' could be 'add' or 'edit' and 'type' could be 'task' or 'column' depending on the action.
DdialogRenderedSets or gets a function called when the dialog is rendered. The Kanban calls this function with 6 arguments - 'dialog', 'editors', 'labels', 'tabs', 'layout', 'taskOrComment'. The dialog is the 'smart-window' instance used as a default Kanban dialog. 'taskOrComment' is object which could be Kanban task or comment. 'editors', 'labels', 'tabs' and 'layout' are JSON objects with key which describes the element type and value which is HTML Element.
DdataSourceDetermines the data source to be visualized in the kanban board. Click for more details. Property object's options:
  • id:string | number - The task's unique ID.
  • checklist:{ completed?: boolean, text?: string }[] - A list of sub-tasks.
  • color:string - A color used to highlight the task's card visually.
  • comments:{ text?: string, time?: Date, userId: string | number }[] - Comments about a task.
  • dueDate:Date - The task's due date.
  • priority:string - The task's priority.
  • progress:number - The task's progress in percentages - a number from 0 to 100.
  • startDate:Date - The task's start date.
  • status:string - The task's status. Has to correspond to the dataField of a column or sub-column from the columns property/array.
  • swimlane:string - The swimlane of the task. Has to correspond to the dataField of a swimlane from the swimlanes property/array, if it is defined.
  • tags:string - A comma-separated list of tags.
  • text:string - The text of the task.
  • userId:string | number - The ID of the user assigned to the task. Has to correspond to the id of an item from the users property/array.
DdataSourceMapDetermines the the relation (mapping) between the Kanban's default fields (keywords) and the data fields from the data source. Not necessary if both match. Only some of the default mapping can be overwritten.
DdragOffsetDetermines the offset of the drag feedback element from the mouse cursor when dragging tasks. The first member of the array is the horizontal offset and the second one - the vertical offset. If set to 'auto', the offset is based on the mouse position when the dragging started.
EeditableSets or gets whether tasks can be edited (including the assigning of users to tasks).
EeditModeDetermines the edit behavior. It could be either singleClick or doubleClick. The dialog edit window is by default opened when user double clicks on a Kanban task.
FformatStringDateSets or gets the format string of the "Due date" label and the "Start date" and "Due date" editors.
FformatStringTimeSets or gets the format string of comments time stamp.
HheaderPositionSets or gets the header position. The header contains the Customize, Filter, Sort, and Search buttons.
HhierarchySets or gets the way column hierarchy is represented.
LlocaleSets or gets the locale. Used in conjunction with the property messages.
MmessagesSets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale.
OonTaskRenderCallback function which can be used for customizing the tasks rendering. The Kanban calls it with 2 arguments - task html element and task data.
OonFilterPrepareCallback function which can be used for customizing the filter items. The function is called with 1 argument - Array of items which will be displayed in the filter drop down. You can modify that array to remove or update items to filter by.
OonSortPrepareCallback function which can be used for customizing the sort items. The function is called with 1 argument - Array of items which will be displayed in the sort drop down. You can modify that array to remove or update items to sort by.
OonColumnHeaderRenderCallback function which can be used for customizing the column header rendering. The Kanban calls it with 3 arguments - column header html element and column data and column data field.
OonColumnFooterRenderCallback function which can be used for customizing the column footer rendering. The Kanban calls it with 3 arguments - column header html element and column data and column data field.
SselectionModeDetermines selection mode.
SstoreHistorySets or gets whether the tasks history will be stored and displayed in the task dialog.
SstoreHistoryItemsSets or gets the task history items that will be stored when storeHistory is enabled.
RrightToLeftSets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts.
RreadonlySets or gets whether the edit dialog is displayed in readonly mode. In that mode it shows only the task details, but the editing is disabled. However, if comments are enabled, you will be able to add comments in the dialog.
SswimlanesDescribes the swimlanes in the kanban board. Sub-columns are not applicable when swimlanes are present. Click for more details. Property object's options:
  • color:string - The swimlane's color.
  • dataField:string - Sets or gets the swimlane's data source bound field. Corresponds to the swimlane field in the data source.
  • label:string - Sets or gets the text displayed in the swimlane.
SswimlanesFromSets or gets the index of the column at which to start the swimlanes.
SswimlanesToSets or gets the index of the column at which to end the swimlanes. By default, swimlanes end at the last column.
TtagsSets or gets the allowed tags. If no tags are listed, all tags from the data source are allowed.
TtaskActionsToggles the visibility of the task actions icon.
TtaskActionsRenderedRepresents a callback function which is called when the task actions menu is created. The task actions element is passed as parameter and allows you to customize the menu. Example: (list) => { list.innerHTML = '
Custom Item
'; list.onclick = () => { alert('clicked'); }}
TtaskCommentsToggles the visibility of the task comments icon.
TtaskDueToggles the visibility of the task due icon.
TtaskPositionSets or gets whether tasks can be shown in all levels of column hierarchy or only on leaf columns.
TtaskPriorityToggles the visibility of the task priority icon (shown when priority is low or high).
TtaskProgressToggles the visibility of task progress bar and the completed sub-tasks label.
TtaskCustomFieldsSets the task custom fields displayed in the card. Each array item should have 'dataField', 'label' 'dataType' and optionally 'visible', 'image' and 'cover' properties. The 'dataField' determines the value, the label is displayed as title, 'dataType' is used for formatting and 'visible' determines whether the field will be displayed. If your string represents an image either URL or Base64, set image: true. If you want to display that image as a cover image, set cover:true, too.
TtaskColorEntireSurfaceThe task's background color depends on the task's color property. By default the color is rendered within the task's left border.
TtaskSubTasksInputDisplays an input in the task's card for adding dynamically a sub task. The 'taskSubTasks' property should be set to a value different than 'none'.
TtaskSubTasksSets the rendering mode of sub tasks. 'none' - default value. Sub tasks are displayed only in the edit dialog. 'onePerRow' - all sub tasks are displayed in the task's card. 'onlyUnfinished' - only tasks which are not completed are displayed in the task's card.
TtaskTagsToggles the visibility of task tags.
TtaskUserIconToggles the visibility of the task user icon.
TtextTemplateSets or gets a template to be applied to task text. Can be a string beginning with # and referencing the id of a template element on the page. Can also be a function that modifies the task text or the template itself. Finally, it can also be a string that will be parsed.
TthemeDetermines the theme. Theme defines the look of the element
PpriorityListDetermines whether the priority list (as defined by the priority property) will be shown when clicking the priority icon. Only applicable if editable privileges are enabled.
PpriorityDetermines the priority Kanban tasks can be assigned to. Example: [{label: 'low', value: 'low'}, {label: 'high', value: 'high'}]
UuserListDetermines whether the user list (as defined by the users property) will be shown when clicking the user icon. Only applicable if editable privileges are enabled.
UusersDetermines the users Kanban tasks can be assigned to and their characteristics and privileges. Click for more details. Property object's options:
  • allowAdd:boolean - Sets whether the user has a privilege to add or copy tasks.
  • allowComment:boolean - Sets whether the user has a privilege to add comments to tasks.
  • allowDrag:boolean - Sets whether the user has a privilege to drag tasks. Works along with the property allowDrag.
  • allowEdit:boolean - Sets whether the user has a privilege to edit tasks. Works along with the property editable.
  • allowRemove:boolean - Sets whether the user has a privilege to remove tasks.
  • id:string | number - The user's unique ID. Corresponds to the userId field in the data source and the property currentUser.
  • image:string - A url to an image representing the user.
  • name:string - The user's name as it will appear in the Users list and "Assigned to" editor.

Events

CchangeThis event is triggered when a task has been updated.
CcloseThis event is triggered when the edit/prompt dialog is closed.
CclosingThis event is triggered when the edit/prompt dialog is about to be closed. The closing operation can be canceled by calling event.preventDefault() in the event handler function.
CcolumnAddThis event is triggered when a column is added.
CcolumnRemoveThis event is triggered when a column is removed.
CcolumnReorderThis event is triggered when a column is reordered.
CcolumnUpdateThis event is triggered when a column is updated.
CcolumnClickThis event is triggered when a column header is clicked.
CcolumnDoubleClickThis event is triggered when a column header is double clicked.
CcolumnShowThis event is triggered when a column is shown by using the column's action menu or the Kanban's 'show' method.
CcolumnHideThis event is triggered when a column is hidden by using the column's action menu or the Kanban's 'hide' method.
CcolumnCollapseThis event is triggered when a column is collapsed by using the column's action menu or the Kanban's 'collapse' method.
CcolumnExpandThis event is triggered when a column is expanded by using the column's action menu or the Kanban's 'expand' method.
CcommentAddThis event is triggered when a comment is added to the Kanban Task.
CcommentRemoveThis event is triggered when a comment is removed from the Kanban Task.
CcommentUpdateThis event is triggered when a comment is updated in the Kanban Task.
DdragEndThis event is triggered when a task is dropped somewhere in the DOM. The dragging operation can be canceled by calling event.preventDefault() in the event handler function.
DdraggingThis event is triggered when the user is dragging a task.
DdragStartThis event is triggered when the user starts dragging task(s). The dragging operation can be canceled by calling event.preventDefault() in the event handler function.
FfilterThis event is triggered when a filter has been applied.
OopenThis event is triggered when the edit/prompt dialog is opened.
OopeningThis event is triggered when the edit/prompt dialog is about to be opened. The opening operation can be canceled by calling event.preventDefault() in the event handler function. If you want to cancel the default Kanban dialog, call event.preventDefault();
SsortThis event is triggered when sorting has been applied.
TtaskBeforeAddThis event is triggered before a new task is added. You can use the event.detail.value and event.detail.id to customize the new Task before adding it to the Kanban. Example: kanban.onTaskBeforeAdd = (event) => { const data = event.detail.value; const id = event.detail.id; event.detail.id = 'BG12';}
TtaskAddThis event is triggered when a new task is added. Example: kanban.onTaskAdd = (event) => { const data = event.detail.value; const id = event.detail.id; }
TtaskRemoveThis event is triggered when a task is removed.
TtaskUpdateThis event is triggered when a task is updated.
TtaskClickThis event is triggered when a task is clicked.
TtaskDoubleClickThis event is triggered when a task is double clicked.

Methods

AaddFilterAdds filtering. Example: const filterGroup = new Smart.FilterGroup(); const filterObject = filterGroup.createFilter('string', 'Italy', 'contains'); filterGroup.addFilter('and', filterObject); kanban.addFilter([['Country', filterGroup]]);
AaddSortAdds sorting. Example: kanban.addSort(['Country'], 'ascending');
AaddTaskAdds a task to a Kanban column. If no data is specified, an empty task is added to the first column.
AaddColumnAdds a column to a Kanban. If no data is specified, an empty column is added.
BbeginEditBegins an edit operation
CcancelEditEnds the current edit operation and discards changes
CclosePanelCloses any open header panel (drop down)
CcollapseCollapses a Kanban column.
CclearSelectionClears the Kanban's selection.
HhideHides a Kanban column.
CcopyTaskCreates a copy of a task in the same column.
EendEditEnds the current edit operation and saves changes
EensureVisibleMakes sure a task is visible by scrolling to it. If succcessful, the method returns the HTML element of the task.
EexpandExpands a Kanban column.
EexpandAllExpands all Kanban columns.
EexportDataExports the Kanban's data.
GgetColumnGets the data of a column. The returned value is a JSON object with the following fields: 'label', 'dataField', 'collapsed', 'collapsible', 'allowRemove', 'editable', 'reorder', 'orientation'.
GgetTaskGets the data of a task. The returned value is a JSON object with the following fields: 'checklist', 'id', 'color', 'comments', 'history', 'dueDate', 'startDate', 'priority', 'progress', 'status', 'swimlane', 'tags', 'text', 'description', 'userId', 'createdUserId', 'createdDate', 'updatedUserId', 'updatedDate'
GgetSelectedTasksGets the selected ids. The returned value is an array. Each item in the array is the 'id' of a selected task.
GgetStateGets the Kanban's state. Returns an object with the following type: { collapsed: {}, dataSource: [], filtering: { filters: [], operator: string }, selection: { selected: [], selectionStart?: number | string, selectionInColumn: string, swimlane: string }, sorting: { dataFields: [], dataTypes: [], orderBy: [] }, tabs: [], visibility: { taskActions: boolean, taskComments: boolean, taskDue: boolean, taskPriority: boolean, taskProgress: boolean, taskTags: boolean, taskUserIcon: boolean } }
LloadStateLoads the Kanban's state.
MmoveTaskMoves a task to a different column.
OopenCustomizePanelOpens the "Customize tasks" header panel (drop down)
OopenFilterPanelOpens the "Filter" header panel (drop down)
OopenSortPanelOpens the "Sort" header panel (drop down)
RremoveFilterRemoves filtering
RremoveSortRemoves sorting
RremoveTaskRemoves a task.
RremoveColumnRemoves a column.
SsaveStateSaves the Kanban's state to the browser's localStorage.
SshowShows a Kanban column.
SshowAllColumnsShows all Kanban columns.
SselectTaskSelects a task.
UunselectTaskUnselects a task.
UupdateTaskUpdates a task.
UupdateColumnUpdates a column.

Properties

allowColumnReorderboolean

Enables or disables column reordering. When this property is set to true and allowDrag is enabled, users will be able to reoder columns through drag & drop. For example: Click and drag the first column's header and drop it over another column.

Default value

false

Example

Set the allowColumnReorder property.

 <smart-kanban allow-column-reorder></smart-kanban>

Set the allowColumnReorder property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.allowColumnReorder = false;

Get the allowColumnReorder property.

 const kanban = document.querySelector('smart-kanban');
 let allowColumnReorder = kanban.allowColumnReorder;

allowColumnEditboolean

Enables or disables column editing. When this property is set to true, users will be able to dynamically change the column's header label by double clicking on it.

Default value

false

Example

Set the allowColumnEdit property.

 <smart-kanban allow-column-edit></smart-kanban>

Set the allowColumnEdit property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.allowColumnEdit = false;

Get the allowColumnEdit property.

 const kanban = document.querySelector('smart-kanban');
 let allowColumnEdit = kanban.allowColumnEdit;

allowColumnRemoveboolean

Enables or disables column removing. When this property is set to true, users will be able to dynamically remove a column through the column actions menu. the 'columnActions' property should be true.

Default value

false

Example

Set the allowColumnRemove property.

 <smart-kanban allow-column-remove></smart-kanban>

Set the allowColumnRemove property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.allowColumnRemove = false;

Get the allowColumnRemove property.

 const kanban = document.querySelector('smart-kanban');
 let allowColumnRemove = kanban.allowColumnRemove;

allowColumnHideboolean

Enables or disables column hiding. When this property is set to true, users will be able to dynamically hide a column through the column actions menu. the 'columnActions' property should be true.

Default value

false

Example

Set the allowColumnHide property.

 <smart-kanban allow-column-hide></smart-kanban>

Set the allowColumnHide property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.allowColumnHide = false;

Get the allowColumnHide property.

 const kanban = document.querySelector('smart-kanban');
 let allowColumnHide = kanban.allowColumnHide;

addNewButtonboolean

Toggles the visibility of the column buttons for adding tasks. A particular button can be disabled by setting addNewButton in the column's definition to false.

Default value

false

Example

Set the addNewButton property.

 <smart-kanban add-new-button></smart-kanban>

Set the addNewButton property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.addNewButton = false;

Get the addNewButton property.

 const kanban = document.querySelector('smart-kanban');
 let addNewButton = kanban.addNewButton;

addNewButtonDisplayMode"top" | "bottom" | "both"

Determines whether the add button is visible in the column header and/or after the tasks in the column.

Default value

"both"

Example

Set the addNewButtonDisplayMode property.

 <smart-kanban add-new-button-display-mode='both'></smart-kanban>

Set the addNewButtonDisplayMode property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.addNewButtonDisplayMode = 'top';

Get the addNewButtonDisplayMode property.

 const kanban = document.querySelector('smart-kanban');
 let addNewButtonDisplayMode = kanban.addNewButtonDisplayMode;

addNewColumnboolean

Sets or gets whether a column with a button for adding new status columns to the Kanban will be displayed.

Default value

false

Example

Set the addNewColumn property.

 <smart-kanban add-new-column></smart-kanban>

Set the addNewColumn property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.addNewColumn = false;

Get the addNewColumn property.

 const kanban = document.querySelector('smart-kanban');
 let addNewColumn = kanban.addNewColumn;

addNewColumnWidthnumber | null

Sets the width of the add new column. The property is used, if the 'columnWidth' property is set, too. It specifies the width of the dynamic new column.

Example

Set the addNewColumnWidth property.

 <smart-kanban add-new-column-width='null'></smart-kanban>

Set the addNewColumnWidth property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.addNewColumnWidth = 300;

Get the addNewColumnWidth property.

 const kanban = document.querySelector('smart-kanban');
 let addNewColumnWidth = kanban.addNewColumnWidth;

allowDragboolean

Allows the dragging of tasks.

Default value

true

Example

Set the allowDrag property.

 <smart-kanban allow-drag></smart-kanban>

Set the allowDrag property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.allowDrag = false;

Get the allowDrag property.

 const kanban = document.querySelector('smart-kanban');
 let allowDrag = kanban.allowDrag;

allowDropboolean

Allows the dropping of tasks.

Default value

true

Example

Set the allowDrop property.

 <smart-kanban allow-drop></smart-kanban>

Set the allowDrop property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.allowDrop = false;

Get the allowDrop property.

 const kanban = document.querySelector('smart-kanban');
 let allowDrop = kanban.allowDrop;

allowDropPlaceholderboolean

Allows the dropping of tasks placeholder. When you drag a task over another task it will make an empty space for the task.

Default value

false

Example

Set the allowDropPlaceholder property.

 <smart-kanban allow-drop-placeholder></smart-kanban>

Set the allowDropPlaceholder property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.allowDropPlaceholder = false;

Get the allowDropPlaceholder property.

 const kanban = document.querySelector('smart-kanban');
 let allowDropPlaceholder = kanban.allowDropPlaceholder;

applyColumnColorToTasksboolean

This property changes the visual appeal of the Kanban columns and tasks. When set to true and the Kanban columns have their 'color' property set, the color is also applied to the tasks and edit dialog.

Default value

false

Example

Set the applyColumnColorToTasks property.

 <smart-kanban apply-column-color-to-tasks></smart-kanban>

Set the applyColumnColorToTasks property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.applyColumnColorToTasks = false;

Get the applyColumnColorToTasks property.

 const kanban = document.querySelector('smart-kanban');
 let applyColumnColorToTasks = kanban.applyColumnColorToTasks;

autoLoadStateboolean

Enables or disables auto load state from the browser's localStorage. Information about tasks and their position and selected state, filtering, sorting, collapsed columns, as well as the values of the properties taskActions, taskComments, taskDue, taskPriority, taskProgress, taskTags, and taskUserIcon is loaded.

Default value

true

Example

Set the autoLoadState property.

 <smart-kanban auto-load-state></smart-kanban>

Set the autoLoadState property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.autoLoadState = false;

Get the autoLoadState property.

 const kanban = document.querySelector('smart-kanban');
 let autoLoadState = kanban.autoLoadState;

autoSaveStateboolean

Enables or disables auto save state to the browser's localStorage. Information about tasks and their position and selected state, filtering, sorting, collapsed columns, as well as the values of the properties taskActions, taskComments, taskDue, taskPriority, taskProgress, taskTags, and taskUserIcon is saved.

Default value

false

Example

Set the autoSaveState property.

 <smart-kanban auto-save-state></smart-kanban>

Set the autoSaveState property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.autoSaveState = false;

Get the autoSaveState property.

 const kanban = document.querySelector('smart-kanban');
 let autoSaveState = kanban.autoSaveState;

autoColumnHeightboolean

Automatically updates the columns height depending on the tasks inside the column. The effect of this property is observed when 'columnColorEntireSurface' is true.

Default value

false

Example

Set the autoColumnHeight property.

 <smart-kanban auto-column-height></smart-kanban>

Set the autoColumnHeight property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.autoColumnHeight = false;

Get the autoColumnHeight property.

 const kanban = document.querySelector('smart-kanban');
 let autoColumnHeight = kanban.autoColumnHeight;

collapsibleboolean

Allows collapsing the card content.

Default value

false

Example

Set the collapsible property.

 <smart-kanban collapsible></smart-kanban>

Set the collapsible property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.collapsible = false;

Get the collapsible property.

 const kanban = document.querySelector('smart-kanban');
 let collapsible = kanban.collapsible;

columnColorsboolean

Displays colors in the column header, when the column's color property is set.

Default value

false

Example

Set the columnColors property.

 <smart-kanban column-colors></smart-kanban>

Set the columnColors property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.columnColors = false;

Get the columnColors property.

 const kanban = document.querySelector('smart-kanban');
 let columnColors = kanban.columnColors;

columnWidthnumber | null

Sets the Kanban columns width. When this property is set, the kanban columns width is set and a horizontal scrollbar may appear.

Example

Set the columnWidth property.

 <smart-kanban column-width='null'></smart-kanban>

Set the columnWidth property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.columnWidth = 300;

Get the columnWidth property.

 const kanban = document.querySelector('smart-kanban');
 let columnWidth = kanban.columnWidth;

columnColorEntireSurfaceboolean

Displays background in the Kanban column.

Default value

false

Example

Set the columnColorEntireSurface property.

 <smart-kanban column-color-entire-surface></smart-kanban>

Set the columnColorEntireSurface property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.columnColorEntireSurface = false;

Get the columnColorEntireSurface property.

 const kanban = document.querySelector('smart-kanban');
 let columnColorEntireSurface = kanban.columnColorEntireSurface;

columnFooterboolean

Displays a column footer which shows the summary of the column.

Default value

false

Example

Set the columnFooter property.

 <smart-kanban column-footer></smart-kanban>

Set the columnFooter property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.columnFooter = false;

Get the columnFooter property.

 const kanban = document.querySelector('smart-kanban');
 let columnFooter = kanban.columnFooter;

columns{ addNewButton?: boolean, collapsed?: boolean, collapsible?: boolean, columns?: [], dataField?: string, label?: string, orientation?: string, selected?: boolean }[]

Describes the columns properties.

Properties

addNewButtonboolean

Sets or gets whether the column's button for adding tasks is visible. Works in conjunction with the Kanban property of the same name.

Default value

true

Get the addNewButton property.

 const kanban = document.querySelector('smart-kanban');
 let addNewButton = kanban.columns[0].addNewButton;

allowRemoveboolean

Sets or gets whether the column can be removed from the column menu.

Default value

true

Get the allowRemove property.

 const kanban = document.querySelector('smart-kanban');
 let allowRemove = kanban.columns[0].allowRemove;

collapsedboolean

Sets or gets whether the column is collapsed.

Default value

false

Get the collapsed property.

 const kanban = document.querySelector('smart-kanban');
 let collapsed = kanban.columns[0].collapsed;

collapsibleboolean

Sets or gets whether the column is collapsible. Works in conjunction with the Kanban property of the same name.

Default value

true

Get the collapsible property.

 const kanban = document.querySelector('smart-kanban');
 let collapsible = kanban.columns[0].collapsible;

columns{ addNewButton?: boolean, collapsed?: string, collapsible?: string, columns?: [], dataField?: string, label?: string, orientation?: string, selected?: string }[]

Sets or gets the column's sub-columns. Sub-columns has the same properties as top-level columns.

Get the columns property.

 const kanban = document.querySelector('smart-kanban');
 let columns = kanban.columns[0].columns;

dataFieldstring

Sets or gets the column's data source bound field. Corresponds to the status field in the data source.

Default value

""

Get the dataField property.

 const kanban = document.querySelector('smart-kanban');
 let dataField = kanban.columns[0].dataField;

labelstring

Sets or gets the text displayed in the column's header.

Default value

""

Get the label property.

 const kanban = document.querySelector('smart-kanban');
 let label = kanban.columns[0].label;

editableboolean

Sets or gets whether a column is editable.

Default value

true

Get the editable property.

 const kanban = document.querySelector('smart-kanban');
 let editable = kanban.columns[0].editable;

visibleboolean

Sets or gets whether a column is visible.

Default value

true

Get the visible property.

 const kanban = document.querySelector('smart-kanban');
 let visible = kanban.columns[0].visible;

reorderboolean

Sets or gets whether a column can be reordered.

Default value

true

Get the reorder property.

 const kanban = document.querySelector('smart-kanban');
 let reorder = kanban.columns[0].reorder;

orientation"vertical" | "horizontal"

Sets or gets whether the tasks in the column flow vertically or horizontally.

Default value

"vertical"

Get the orientation property.

 const kanban = document.querySelector('smart-kanban');
 let orientation = kanban.columns[0].orientation;

selectedboolean

Sets or gets whether the column is selected. Only applicable to sub-columns when hierarchy is 'tabs'.

Default value

false

Get the selected property.

 const kanban = document.querySelector('smart-kanban');
 let selected = kanban.columns[0].selected;

headerTemplateany

Determines whether a column header has a template. You can pass 'string', 'function' or HTMLTemplateElement as a value.

Get the headerTemplate property.

 const kanban = document.querySelector('smart-kanban');
 let headerTemplate = kanban.columns[0].headerTemplate;

widthnumber | null

Sets the Kanban column width. When this property is set, the kanban column width is set and a horizontal scrollbar may appear.

Example

Set the width property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.columns[0].width = 300;

Get the width property.

 const kanban = document.querySelector('smart-kanban');
 let width = kanban.columns[0].width;

Example

Set the columns property.

 <smart-kanban columns='{ label: 'In progress', dataField: 'inProgress' }, { label: 'Testing', dataField: 'testing' }, { label: 'Done', dataField: 'done' }'></smart-kanban>

Set the columns property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.columns = { label: 'In progress', dataField: 'inProgress' }, { label: 'Testing', dataField: 'testing', orientation: 'horizontal', columns: [{ label: 'Manual testing', dataField: 'manualTesting', selected: true, columns: [{ label: 'Desktop devices', dataField: 'desktop' }, { label: 'Mobile devices', dataField: 'mobile', selected: true }] }, { label: 'Unit testing', dataField: 'unitTesting' }] };

Get the columns property.

 const kanban = document.querySelector('smart-kanban');
 let columns = kanban.columns;

columnActionsboolean

Toggles the visibility of the column actions icon.

Default value

false

Example

Set the columnActions property.

 <smart-kanban column-actions></smart-kanban>

Set the columnActions property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.columnActions = false;

Get the columnActions property.

 const kanban = document.querySelector('smart-kanban');
 let columnActions = kanban.columnActions;

columnSummaryboolean

Determines whether task count information is displayed in column headers.

Default value

false

Example

Set the columnSummary property.

 <smart-kanban column-summary></smart-kanban>

Set the columnSummary property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.columnSummary = false;

Get the columnSummary property.

 const kanban = document.querySelector('smart-kanban');
 let columnSummary = kanban.columnSummary;

columnHeaderTemplateany

Determines whether a column header has a template. You can pass 'string', 'function' or HTMLTemplateElement as a value.

Example

Set the columnHeaderTemplate property.

 <smart-kanban column-header-template='#headerTemplate'></smart-kanban>

Set the columnHeaderTemplate property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.columnHeaderTemplate = #headerCustomTemplate;

Get the columnHeaderTemplate property.

 const kanban = document.querySelector('smart-kanban');
 let columnHeaderTemplate = kanban.columnHeaderTemplate;

columnEditMode"header" | "menu" | "headerAndMenu"

Determines the column edit behavior. With the 'header' option, edit starts on double click on the column's label. In 'menu' mode, edit is allowed from the 'columnActions' menu. In 'headerAndMenu' option, column editing includes both options.

Default value

"headerAndMenu"

Example

Set the columnEditMode property.

 <smart-kanban column-edit-mode='true'></smart-kanban>

Set the columnEditMode property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.columnEditMode = 'false';

Get the columnEditMode property.

 const kanban = document.querySelector('smart-kanban');
 let columnEditMode = kanban.columnEditMode;

currentUserstring | number

Sets or gets the id of the current user. Has to correspond to the id of an item from the users property/array. Depending on the current user, different privileges are enabled. If no current user is set, privileges depend on the element's properties.

Default value

""

Example

Set the currentUser property.

 <smart-kanban current-user='1'></smart-kanban>

Set the currentUser property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.currentUser = 2;

Get the currentUser property.

 const kanban = document.querySelector('smart-kanban');
 let currentUser = kanban.currentUser;

disableDialogboolean

Sets or gets whether the default dialog for adding/removing tasks or comments is disabled.

Default value

false

Example

Set the disableDialog property.

 <smart-kanban disable-dialog></smart-kanban>

Set the disableDialog property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.disableDialog = false;

Get the disableDialog property.

 const kanban = document.querySelector('smart-kanban');
 let disableDialog = kanban.disableDialog;

dialogCustomizationFunctionany

Sets or gets a customization function for the dialog. This function can be used to customize the dialog look or to replace it. The Kanban calls this function with 5 arguments - 'dialog', 'taskOrComment', 'editors', 'purpose' and 'type'. The dialog is the 'smart-window' instance used as a default Kanban dialog. 'taskOrComment' is object which could be Kanban task or comment. 'purpose' could be 'add' or 'edit' and 'type' could be 'task' or 'column' depending on the action.

dialogRenderedany

Sets or gets a function called when the dialog is rendered. The Kanban calls this function with 6 arguments - 'dialog', 'editors', 'labels', 'tabs', 'layout', 'taskOrComment'. The dialog is the 'smart-window' instance used as a default Kanban dialog. 'taskOrComment' is object which could be Kanban task or comment. 'editors', 'labels', 'tabs' and 'layout' are JSON objects with key which describes the element type and value which is HTML Element.

dataSource{ id: string | number, checklist?: { completed?: boolean, text?: string }[], color?: string, comments?: { text?: string, time?: Date, userId: string | number }[], dueDate?: Date, priority?: string, progress?: number, startDate?: Date, status?: string, swimlane?: string, tags?: string, text?: string, userId?: string | number }[]

Determines the data source to be visualized in the kanban board.

Properties

idstring | number

The task's unique ID.

Default value

""

Get the id property.

 const kanban = document.querySelector('smart-kanban');
 let id = kanban.dataSource.id;

checklist{ completed?: boolean, text?: string }[]

A list of sub-tasks.

Get the checklist property.

 const kanban = document.querySelector('smart-kanban');
 let checklist = kanban.dataSource.checklist;

colorstring

A color used to highlight the task's card visually.

Default value

"null"

Get the color property.

 const kanban = document.querySelector('smart-kanban');
 let color = kanban.dataSource.color;

comments{ text?: string, time?: Date, userId: string | number }[]

Comments about a task.

Get the comments property.

 const kanban = document.querySelector('smart-kanban');
 let comments = kanban.dataSource.comments;

dueDateDate

The task's due date.

Get the dueDate property.

 const kanban = document.querySelector('smart-kanban');
 let dueDate = kanban.dataSource.dueDate;

prioritystring

The task's priority.

Default value

"normal"

Get the priority property.

 const kanban = document.querySelector('smart-kanban');
 let priority = kanban.dataSource.priority;

progressnumber

The task's progress in percentages - a number from 0 to 100.

Get the progress property.

 const kanban = document.querySelector('smart-kanban');
 let progress = kanban.dataSource.progress;

startDateDate

The task's start date.

Get the startDate property.

 const kanban = document.querySelector('smart-kanban');
 let startDate = kanban.dataSource.startDate;

statusstring

The task's status. Has to correspond to the dataField of a column or sub-column from the columns property/array.

Default value

""

Get the status property.

 const kanban = document.querySelector('smart-kanban');
 let status = kanban.dataSource.status;

swimlanestring

The swimlane of the task. Has to correspond to the dataField of a swimlane from the swimlanes property/array, if it is defined.

Default value

"null"

Get the swimlane property.

 const kanban = document.querySelector('smart-kanban');
 let swimlane = kanban.dataSource.swimlane;

tagsstring

A comma-separated list of tags.

Default value

""

Get the tags property.

 const kanban = document.querySelector('smart-kanban');
 let tags = kanban.dataSource.tags;

textstring

The text of the task.

Default value

""

Get the text property.

 const kanban = document.querySelector('smart-kanban');
 let text = kanban.dataSource.text;

userIdstring | number

The ID of the user assigned to the task. Has to correspond to the id of an item from the users property/array.

Get the userId property.

 const kanban = document.querySelector('smart-kanban');
 let userId = kanban.dataSource.userId;

Example

Set the dataSource property.

 <smart-kanban data-source='["item 1", "item 2"]'></smart-kanban>

Set the dataSource property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.dataSource = ["new item 1", "new item 2"];

Get the dataSource property.

 const kanban = document.querySelector('smart-kanban');
 let dataSource = kanban.dataSource;

dataSourceMap{ checklist?: string; color?: string; comments?: string; dueDate?: string; id?: string; priority?: string; progress?: string; startDate?: string; status?: string; swimlane?: string; tags?: string; text?: string; userId?: string; createdUserId?: string; updatedUserId?: string; createdDate?: Date; updatedDate?: Date;}

Determines the the relation (mapping) between the Kanban's default fields (keywords) and the data fields from the data source. Not necessary if both match. Only some of the default mapping can be overwritten.

Default value

{ checklist: 'checklist', color: 'color', comments: 'comments', dueDate: 'dueDate', id: 'id', priority: 'priority', progress: 'progress', startDate: 'startDate', status: 'status', swimlane: 'swimlane', tags: 'tags', text: 'text', userId: 'userId'. createdUserId: 'createdUserId', createdDate: 'createdDate', updatedUserId: 'updatedUserId', updatedDate: 'updatedDate' }

Example

Set the dataSourceMap property.

 <smart-kanban data-source-map='{ checklist: 'toDoList', comments: 'feedback', status: 'dataField' }'></smart-kanban>

Set the dataSourceMap property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.dataSourceMap = { id: 'ID', startDate: 'start', status: 'status', swimlane: 'category' };

Get the dataSourceMap property.

 const kanban = document.querySelector('smart-kanban');
 let dataSourceMap = kanban.dataSourceMap;

dragOffsetboolean

Determines the offset of the drag feedback element from the mouse cursor when dragging tasks. The first member of the array is the horizontal offset and the second one - the vertical offset. If set to 'auto', the offset is based on the mouse position when the dragging started.

Default value

auto

Example

Set the dragOffset property.

 <smart-kanban drag-offset></smart-kanban>

Set the dragOffset property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.dragOffset = auto;

Get the dragOffset property.

 const kanban = document.querySelector('smart-kanban');
 let dragOffset = kanban.dragOffset;

editableboolean

Sets or gets whether tasks can be edited (including the assigning of users to tasks).

Default value

false

Example

Set the editable property.

 <smart-kanban editable></smart-kanban>

Set the editable property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.editable = false;

Get the editable property.

 const kanban = document.querySelector('smart-kanban');
 let editable = kanban.editable;

editMode"doubleClick" | "singleClick"

Determines the edit behavior. It could be either singleClick or doubleClick. The dialog edit window is by default opened when user double clicks on a Kanban task.

Default value

"doubleClick"

Example

Set the editMode property.

 <smart-kanban edit-mode='doubleClick'></smart-kanban>

Set the editMode property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.editMode = 'singleClick';

Get the editMode property.

 const kanban = document.querySelector('smart-kanban');
 let editMode = kanban.editMode;

formatStringDatestring

Sets or gets the format string of the "Due date" label and the "Start date" and "Due date" editors.

Default value

"d"

Example

Set the formatStringDate property.

 <smart-kanban format-string-date='dddd-MMMM-yyyy'></smart-kanban>

Set the formatStringDate property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.formatStringDate = 'M/d/yyyy';

Get the formatStringDate property.

 const kanban = document.querySelector('smart-kanban');
 let formatStringDate = kanban.formatStringDate;

formatStringTimestring

Sets or gets the format string of comments time stamp.

Default value

"MMM d, HH:mm"

Example

Set the formatStringTime property.

 <smart-kanban format-string-time='HH:mm'></smart-kanban>

Set the formatStringTime property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.formatStringTime = 'MMM d, h:mm tt';

Get the formatStringTime property.

 const kanban = document.querySelector('smart-kanban');
 let formatStringTime = kanban.formatStringTime;

headerPosition"none" | "top" | "bottom"

Sets or gets the header position. The header contains the Customize, Filter, Sort, and Search buttons.

Default value

"none"

Example

Set the headerPosition property.

 <smart-kanban header-position='top'></smart-kanban>

Set the headerPosition property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.headerPosition = 'bottom';

Get the headerPosition property.

 const kanban = document.querySelector('smart-kanban');
 let headerPosition = kanban.headerPosition;

hierarchy"columns" | "tabs"

Sets or gets the way column hierarchy is represented.

Allowed Values

  • "columns" - Sub-columns are represented as nested columns.
  • "tabs" - Sub-columns are represented as nested tabs. In this case, each sub-column has the property selected that denotes if its contents is visible.

Default value

"columns"

Example

Set the hierarchy property.

 <smart-kanban hierarchy='tabs'></smart-kanban>

Set the hierarchy property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.hierarchy = 'columns';

Get the hierarchy property.

 const kanban = document.querySelector('smart-kanban');
 let hierarchy = kanban.hierarchy;

localestring

Sets or gets the locale. Used in conjunction with the property messages.

Default value

"en"

Example

Set the locale property.

 <smart-kanban locale='de'></smart-kanban>

Set the locale property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.locale = 'fr';

Get the locale property.

 const kanban = document.querySelector('smart-kanban');
 let locale = kanban.locale;

messagesobject

Sets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale.

Default value




Example

Set the messages property.

 <smart-kanban messages='{ 'he': { 'addFilter': 'הוסף פילטר', 'and': 'ו', 'apply': 'להגיש מועמדות', 'booleanFirst': '☐', 'booleanLast': '☑', 'cancel': 'בטל', 'CONTAINS': 'מכיל', 'CONTAINS_CASE_SENSITIVE': 'מכיל (רגיש רישיות)', 'dateFirst': '1', 'dateLast': '9', 'DOES_NOT_CONTAIN': 'לא מכיל', 'DOES_NOT_CONTAIN_CASE_SENSITIVE': 'אינו מכיל (רגיש רישיות)', 'EMPTY': 'ריק', 'ENDS_WITH': 'נגמר עם', 'ENDS_WITH_CASE_SENSITIVE': 'מסתיים ב (רגיש רישיות)', 'EQUAL': 'שווה', 'EQUAL_CASE_SENSITIVE': 'שווה (רגיש אותיות רישיות)', 'filter': 'סנן', 'filteredByMultiple': '{{n}} פילטרים', 'filteredByOne': '1 פילטר', 'filterValuePlaceholder': 'ערך', 'find': 'מצא שדה', 'findInView': 'מצא בתצוגה', 'firstBy': 'מיין לפי', 'found': '{{nth}} מתוך {{n}}', 'from': 'מ', 'GREATER_THAN': 'גדול מ', 'GREATER_THAN_OR_EQUAL': 'גדול או שווה', 'LESS_THAN': 'פחות מ', 'LESS_THAN_OR_EQUAL': 'פחות מ או שווה', 'noFilters': 'לא הוחל מסננים', 'noResults': 'אין תוצאות', 'noSorting': 'לא מיושם מיון', 'NOT_EMPTY': 'לא ריק', 'NOT_EQUAL': 'לא שווה', 'NOT_NULL': 'לא ריק', 'NULL': 'ריק', 'numberFirst': '1', 'numberLast': '9', 'ok': 'בסדר', 'or': 'או', 'pickAnother': 'בחר שדה אחר למיין לפי', 'sort': 'סוג', 'sortedByMultiple': 'ממוין לפי שדות {{n}}', 'sortedByOne': 'מסודר לפי שדה 1', 'STARTS_WITH': 'starts with', 'STARTS_WITH_CASE_SENSITIVE': 'מתחיל עם', 'stringFirst': 'א', 'stringLast': 'ז', 'thenBy': 'ואז על ידי', 'where': 'איפה', 'actionsIcon': 'סמל פעולות', 'addNewStatus': 'סטטוס חדש', 'addNewTask': 'הוסף משימה חדשה', 'addSubtask': 'הוסף משימת משנה', 'assignedTo': 'שהוקצה ל', 'checklist': 'רשימת מטלות', 'color': 'צבע', 'commentsIcon': 'סמל הערות', 'copy': 'עותק', 'customize': 'התאם אישית משימות', 'dueDate': 'תאריך להגשה', 'edit': 'ערוך', 'editTask': 'ערוך את המשימה "{{taskId}}"', 'high': 'גבוה', 'low': 'נמוך', 'newComment': 'תגובה חדשה', 'newSubtask': 'תת-משימה חדשה', 'normal': 'רגיל', 'priority': 'עדיפות', 'priorityIcon': 'סמל עדיפות', 'progress': 'התקדמות', 'promptComment': 'האם אתה בטוח שברצונך להסיר תגובה זו?', 'promptTask': 'האם אתה בטוח שברצונך להסיר את המשימה "{{taskText}}"?', 'remove': 'הסר', 'removeSubtask': 'הסר את תת המשנה', 'send': 'שלח', 'startDate': 'תאריך התחלה', 'status': 'סטטוס', 'swimlane': 'נתיב שחייה', 'tags': 'תגיות', 'text': 'טקסט', 'userId': 'תעודת זהות של המשתמש', 'userIcon': 'סמל משתמש' } }'></smart-kanban>

Set the messages property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.messages = { 'en': { 'addFilter': '+ Add filter', 'and': 'And', 'apply': 'Apply', 'booleanFirst': '☐', 'booleanLast': '☑', 'cancel': 'Cancel', 'CONTAINS': 'contains', 'CONTAINS_CASE_SENSITIVE': 'contains (case sensitive)', 'dateFirst': '1', 'dateLast': '9', 'DOES_NOT_CONTAIN': 'does not contain', 'DOES_NOT_CONTAIN_CASE_SENSITIVE': 'does not contain (case sensitive)', 'EMPTY': 'empty', 'ENDS_WITH': 'ends with', 'ENDS_WITH_CASE_SENSITIVE': 'ends with (case sensitive)', 'EQUAL': 'equal', 'EQUAL_CASE_SENSITIVE': 'equal (case sensitive)', 'filter': 'Filter', 'filteredByMultiple': '{{n}} filters', 'filteredByOne': '1 filter', 'filterValuePlaceholder': 'Value', 'find': 'Find a field', 'findInView': 'Find in view', 'firstBy': 'Sort by', 'found': '{{nth}} of {{n}}', 'from': 'from', 'GREATER_THAN': 'greater than', 'GREATER_THAN_OR_EQUAL': 'greater than or equal', 'LESS_THAN': 'less than', 'LESS_THAN_OR_EQUAL': 'less than or equal', 'noFilters': 'No filters applied', 'noResults': 'No results', 'noSorting': 'No sorting applied', 'NOT_EMPTY': 'not empty', 'NOT_EQUAL': 'not equal', 'NOT_NULL': 'not null', 'NULL': 'null', 'numberFirst': '1', 'numberLast': '9', 'ok': 'OK', 'or': 'Or', 'pickAnother': 'Pick another field to sort by', 'sort': 'Sort', 'sortedByMultiple': 'Sorted by {{n}} fields', 'sortedByOne': 'Sorted by 1 field', 'STARTS_WITH': 'starts with', 'STARTS_WITH_CASE_SENSITIVE': 'starts with (case sensitive)', 'stringFirst': 'A', 'stringLast': 'Z', 'thenBy': 'then by', 'where': 'Where', 'actionsIcon': 'Actions icon', 'addNewStatus': 'New status', 'addNewTask': 'Add new task', 'addSubtask': 'Add subtask', 'assignedTo': 'Assigned to', 'checklist': 'Checklist', 'color': 'Color', 'commentsIcon': 'Comments icon', 'copy': 'Copy', 'customize': 'Customize tasks', 'dueDate': 'Due date', 'edit': 'Edit', 'editTask': 'Edit task "{{taskId}}"', 'high': 'High', 'low': 'Low', 'newComment': 'New comment', 'newSubtask': 'New subtask', 'normal': 'Normal', 'priority': 'Priority', 'priorityIcon': 'Priority icon', 'progress': 'Progress', 'promptComment': 'Are you sure you want to remove this comment?', 'promptTask': 'Are you sure you want to remove the task "{{taskText}}"?', 'remove': 'Remove', 'removeSubtask': 'Remove subtask', 'send': 'Send', 'startDate': 'Start date', 'status': 'Status', 'swimlane': 'Swimlane', 'tags': 'Tags', 'text': 'Text', 'userId': 'User ID', 'userIcon': 'User icon' } };

Get the messages property.

 const kanban = document.querySelector('smart-kanban');
 let messages = kanban.messages;

onTaskRenderany

Callback function which can be used for customizing the tasks rendering. The Kanban calls it with 2 arguments - task html element and task data.

onFilterPrepareany

Callback function which can be used for customizing the filter items. The function is called with 1 argument - Array of items which will be displayed in the filter drop down. You can modify that array to remove or update items to filter by.

onSortPrepareany

Callback function which can be used for customizing the sort items. The function is called with 1 argument - Array of items which will be displayed in the sort drop down. You can modify that array to remove or update items to sort by.

onColumnHeaderRenderany

Callback function which can be used for customizing the column header rendering. The Kanban calls it with 3 arguments - column header html element and column data and column data field.

onColumnFooterRenderany

Callback function which can be used for customizing the column footer rendering. The Kanban calls it with 3 arguments - column header html element and column data and column data field.

selectionMode"zeroOrOne" | "zeroOrManyExtended"

Determines selection mode.

Allowed Values

  • "zeroOrOne" - Only one task can optionally be selected.
  • "zeroOrManyExtended" - One or more items can optionally be selected; selection with Ctrl and Shift is allowed.

Default value

"zeroOrOne"

Example

Set the selectionMode property.

 <smart-kanban selection-mode='zeroOrManyExtended'></smart-kanban>

Set the selectionMode property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.selectionMode = 'zeroOrOne';

Get the selectionMode property.

 const kanban = document.querySelector('smart-kanban');
 let selectionMode = kanban.selectionMode;

storeHistoryboolean

Sets or gets whether the tasks history will be stored and displayed in the task dialog.

Default value

false

Example

Set the storeHistory property.

 <smart-kanban store-history></smart-kanban>

Set the storeHistory property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.storeHistory = true;

Get the storeHistory property.

 const kanban = document.querySelector('smart-kanban');
 let storeHistory = kanban.storeHistory;

storeHistoryItemsnumber

Sets or gets the task history items that will be stored when storeHistory is enabled.

Default value

20

Example

Set the storeHistoryItems property.

 <smart-kanban store-history-items='10'></smart-kanban>

Set the storeHistoryItems property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.storeHistoryItems = 30;

Get the storeHistoryItems property.

 const kanban = document.querySelector('smart-kanban');
 let storeHistoryItems = kanban.storeHistoryItems;

rightToLeftboolean

Sets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts.

Default value

false

Example

Set the rightToLeft property.

 <smart-kanban right-to-left></smart-kanban>

Set the rightToLeft property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.rightToLeft = true;

Get the rightToLeft property.

 const kanban = document.querySelector('smart-kanban');
 let rightToLeft = kanban.rightToLeft;

readonlyboolean

Sets or gets whether the edit dialog is displayed in readonly mode. In that mode it shows only the task details, but the editing is disabled. However, if comments are enabled, you will be able to add comments in the dialog.

Default value

false

Example

Set the readonly property.

 <smart-kanban readonly></smart-kanban>

Set the readonly property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.readonly = true;

Get the readonly property.

 const kanban = document.querySelector('smart-kanban');
 let readonly = kanban.readonly;

swimlanesstring | { color?: string, dataField?: string, label?: string }[]

Describes the swimlanes in the kanban board. Sub-columns are not applicable when swimlanes are present.

Properties

colorstring

The swimlane's color.

Default value

"null"

Get the color property.

 const kanban = document.querySelector('smart-kanban');
 let color = kanban.swimlanes[0].color;

dataFieldstring

Sets or gets the swimlane's data source bound field. Corresponds to the swimlane field in the data source.

Default value

""

Get the dataField property.

 const kanban = document.querySelector('smart-kanban');
 let dataField = kanban.swimlanes[0].dataField;

labelstring

Sets or gets the text displayed in the swimlane.

Default value

""

Get the label property.

 const kanban = document.querySelector('smart-kanban');
 let label = kanban.swimlanes[0].label;

Example

Set the swimlanes property.

 <smart-kanban swimlanes='{ label: 'Client Energo', dataField: 'client1' }, { label: 'Client Sim-Prod Ltd.', dataField: 'client2', color: '#C90086' }'></smart-kanban>

Set the swimlanes property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.swimlanes = { label: 'Client Sim-Prod Ltd.', dataField: 'client2', color: '#C90086' }, { label: 'Other clients', dataField: 'other', color: '#03C7C0' };

Get the swimlanes property.

 const kanban = document.querySelector('smart-kanban');
 let swimlanes = kanban.swimlanes;

swimlanesFromnumber

Sets or gets the index of the column at which to start the swimlanes.

Default value

0

Example

Set the swimlanesFrom property.

 <smart-kanban swimlanes-from='1'></smart-kanban>

Set the swimlanesFrom property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.swimlanesFrom = 3;

Get the swimlanesFrom property.

 const kanban = document.querySelector('smart-kanban');
 let swimlanesFrom = kanban.swimlanesFrom;

swimlanesTonumber

Sets or gets the index of the column at which to end the swimlanes. By default, swimlanes end at the last column.

Example

Set the swimlanesTo property.

 <smart-kanban swimlanes-to='4'></smart-kanban>

Set the swimlanesTo property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.swimlanesTo = 3;

Get the swimlanesTo property.

 const kanban = document.querySelector('smart-kanban');
 let swimlanesTo = kanban.swimlanesTo;

tags[]

Sets or gets the allowed tags. If no tags are listed, all tags from the data source are allowed.

Example

Set the tags property.

 <smart-kanban tags='['method', 'data']'></smart-kanban>

Set the tags property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.tags = ['research', 'property', 'localization'];

Get the tags property.

 const kanban = document.querySelector('smart-kanban');
 let tags = kanban.tags;

taskActionsboolean

Toggles the visibility of the task actions icon.

Default value

false

Example

Set the taskActions property.

 <smart-kanban task-actions></smart-kanban>

Set the taskActions property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.taskActions = false;

Get the taskActions property.

 const kanban = document.querySelector('smart-kanban');
 let taskActions = kanban.taskActions;

taskActionsRenderedany

Represents a callback function which is called when the task actions menu is created. The task actions element is passed as parameter and allows you to customize the menu. Example: (list) => { list.innerHTML = '

Custom Item
'; list.onclick = () => { alert('clicked'); }}

taskCommentsboolean

Toggles the visibility of the task comments icon.

Default value

false

Example

Set the taskComments property.

 <smart-kanban task-comments></smart-kanban>

Set the taskComments property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.taskComments = false;

Get the taskComments property.

 const kanban = document.querySelector('smart-kanban');
 let taskComments = kanban.taskComments;

taskDueboolean

Toggles the visibility of the task due icon.

Default value

false

Example

Set the taskDue property.

 <smart-kanban task-due></smart-kanban>

Set the taskDue property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.taskDue = false;

Get the taskDue property.

 const kanban = document.querySelector('smart-kanban');
 let taskDue = kanban.taskDue;

taskPosition"all" | "leaf"

Sets or gets whether tasks can be shown in all levels of column hierarchy or only on leaf columns.

Allowed Values

  • "all" - Tasks can be shown in all levels of column hierarchy.
  • "leaf" - Tasks can be shown only on leaf columns.

Default value

"false"

Example

Set the taskPosition property.

 <smart-kanban task-position='leaf'></smart-kanban>

Set the taskPosition property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.taskPosition = 'all';

Get the taskPosition property.

 const kanban = document.querySelector('smart-kanban');
 let taskPosition = kanban.taskPosition;

taskPriorityboolean

Toggles the visibility of the task priority icon (shown when priority is low or high).

Default value

true

Example

Set the taskPriority property.

 <smart-kanban task-priority></smart-kanban>

Set the taskPriority property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.taskPriority = false;

Get the taskPriority property.

 const kanban = document.querySelector('smart-kanban');
 let taskPriority = kanban.taskPriority;

taskProgressboolean

Toggles the visibility of task progress bar and the completed sub-tasks label.

Default value

false

Example

Set the taskProgress property.

 <smart-kanban task-progress></smart-kanban>

Set the taskProgress property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.taskProgress = false;

Get the taskProgress property.

 const kanban = document.querySelector('smart-kanban');
 let taskProgress = kanban.taskProgress;

taskCustomFieldsarray

Sets the task custom fields displayed in the card. Each array item should have 'dataField', 'label' 'dataType' and optionally 'visible', 'image' and 'cover' properties. The 'dataField' determines the value, the label is displayed as title, 'dataType' is used for formatting and 'visible' determines whether the field will be displayed. If your string represents an image either URL or Base64, set image: true. If you want to display that image as a cover image, set cover:true, too.

taskColorEntireSurfaceboolean

The task's background color depends on the task's color property. By default the color is rendered within the task's left border.

Default value

false

Example

Set the taskColorEntireSurface property.

 <smart-kanban task-color-entire-surface></smart-kanban>

Set the taskColorEntireSurface property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.taskColorEntireSurface = false;

Get the taskColorEntireSurface property.

 const kanban = document.querySelector('smart-kanban');
 let taskColorEntireSurface = kanban.taskColorEntireSurface;

taskSubTasksInputboolean

Displays an input in the task's card for adding dynamically a sub task. The 'taskSubTasks' property should be set to a value different than 'none'.

Default value

true

Example

Set the taskSubTasksInput property.

 <smart-kanban task-sub-tasks-input></smart-kanban>

Set the taskSubTasksInput property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.taskSubTasksInput = false;

Get the taskSubTasksInput property.

 const kanban = document.querySelector('smart-kanban');
 let taskSubTasksInput = kanban.taskSubTasksInput;

taskSubTasks"none" | "onePerRow" | "onlyUnfinished"

Sets the rendering mode of sub tasks. 'none' - default value. Sub tasks are displayed only in the edit dialog. 'onePerRow' - all sub tasks are displayed in the task's card. 'onlyUnfinished' - only tasks which are not completed are displayed in the task's card.

Default value

"none"

Example

Set the taskSubTasks property.

 <smart-kanban task-sub-tasks='onePerRow'></smart-kanban>

Set the taskSubTasks property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.taskSubTasks = 'onlyUnfinished';

Get the taskSubTasks property.

 const kanban = document.querySelector('smart-kanban');
 let taskSubTasks = kanban.taskSubTasks;

taskTagsboolean

Toggles the visibility of task tags.

Default value

true

Example

Set the taskTags property.

 <smart-kanban task-tags></smart-kanban>

Set the taskTags property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.taskTags = false;

Get the taskTags property.

 const kanban = document.querySelector('smart-kanban');
 let taskTags = kanban.taskTags;

taskUserIconboolean

Toggles the visibility of the task user icon.

Default value

true

Example

Set the taskUserIcon property.

 <smart-kanban task-user-icon></smart-kanban>

Set the taskUserIcon property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.taskUserIcon = false;

Get the taskUserIcon property.

 const kanban = document.querySelector('smart-kanban');
 let taskUserIcon = kanban.taskUserIcon;

textTemplatestring | (settings: { data: any, task: HTMLDivElement, text: string, template?: string }) => void

Sets or gets a template to be applied to task text. Can be a string beginning with # and referencing the id of a template element on the page. Can also be a function that modifies the task text or the template itself. Finally, it can also be a string that will be parsed.

Example

Set the textTemplate property.

 <smart-kanban text-template='true'></smart-kanban>

Set the textTemplate property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.textTemplate = false;

Get the textTemplate property.

 const kanban = document.querySelector('smart-kanban');
 let textTemplate = kanban.textTemplate;

themestring

Determines the theme. Theme defines the look of the element

Default value

""

Example

Set the theme property.

 <smart-kanban theme='blue'></smart-kanban>

Set the theme property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.theme = 'red';

Get the theme property.

 const kanban = document.querySelector('smart-kanban');
 let theme = kanban.theme;

priorityListboolean

Determines whether the priority list (as defined by the priority property) will be shown when clicking the priority icon. Only applicable if editable privileges are enabled.

Default value

false

Example

Set the priorityList property.

 <smart-kanban priority-list></smart-kanban>

Set the priorityList property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.priorityList = false;

Get the priorityList property.

 const kanban = document.querySelector('smart-kanban');
 let priorityList = kanban.priorityList;

priority{ label: string, value: string }[]

Determines the priority Kanban tasks can be assigned to. Example: [{label: 'low', value: 'low'}, {label: 'high', value: 'high'}]

Properties

labelstring

The priority label displayed.

Default value

""

Get the label property.

 const kanban = document.querySelector('smart-kanban');
 let label = kanban.priority.label;

valuestring

The priority value.

Default value

""

Get the value property.

 const kanban = document.querySelector('smart-kanban');
 let value = kanban.priority.value;

Example

Set the priority property.

 <smart-kanban priority='true'></smart-kanban>

Set the priority property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.priority = false;

Get the priority property.

 const kanban = document.querySelector('smart-kanban');
 let priority = kanban.priority;

userListboolean

Determines whether the user list (as defined by the users property) will be shown when clicking the user icon. Only applicable if editable privileges are enabled.

Default value

false

Example

Set the userList property.

 <smart-kanban user-list></smart-kanban>

Set the userList property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.userList = false;

Get the userList property.

 const kanban = document.querySelector('smart-kanban');
 let userList = kanban.userList;

users{ allowAdd?: boolean, allowComment?: boolean, allowDrag?: boolean, allowEdit?: boolean, allowRemove?: boolean, id: string | number, image?: string, name?: string }[]

Determines the users Kanban tasks can be assigned to and their characteristics and privileges.

Properties

allowAddboolean

Sets whether the user has a privilege to add or copy tasks.

Default value

true

Get the allowAdd property.

 const kanban = document.querySelector('smart-kanban');
 let allowAdd = kanban.users[0].allowAdd;

allowCommentboolean

Sets whether the user has a privilege to add comments to tasks.

Default value

true

Get the allowComment property.

 const kanban = document.querySelector('smart-kanban');
 let allowComment = kanban.users[0].allowComment;

allowDragboolean

Sets whether the user has a privilege to drag tasks. Works along with the property allowDrag.

Default value

true

Get the allowDrag property.

 const kanban = document.querySelector('smart-kanban');
 let allowDrag = kanban.users[0].allowDrag;

allowEditboolean

Sets whether the user has a privilege to edit tasks. Works along with the property editable.

Default value

true

Get the allowEdit property.

 const kanban = document.querySelector('smart-kanban');
 let allowEdit = kanban.users[0].allowEdit;

allowRemoveboolean

Sets whether the user has a privilege to remove tasks.

Default value

true

Get the allowRemove property.

 const kanban = document.querySelector('smart-kanban');
 let allowRemove = kanban.users[0].allowRemove;

idstring | number

The user's unique ID. Corresponds to the userId field in the data source and the property currentUser.

Get the id property.

 const kanban = document.querySelector('smart-kanban');
 let id = kanban.users[0].id;

imagestring

A url to an image representing the user.

Default value

""

Get the image property.

 const kanban = document.querySelector('smart-kanban');
 let image = kanban.users[0].image;

namestring

The user's name as it will appear in the Users list and "Assigned to" editor.

Default value

""

Get the name property.

 const kanban = document.querySelector('smart-kanban');
 let name = kanban.users[0].name;

Example

Set the users property.

 <smart-kanban users='true'></smart-kanban>

Set the users property by using the HTML Element's instance.

 const kanban = document.querySelector('smart-kanban');
 kanban.users = false;

Get the users property.

 const kanban = document.querySelector('smart-kanban');
 let users = kanban.users;

Events

changeCustomEvent

This event is triggered when a task has been updated.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onChange

Arguments

evCustomEvent
ev.detailObject
ev.detail.oldValue - The old data of the task
ev.detail.task - The HTML element of the task whose data has been changed
ev.detail.value - The new data of the task

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of change event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('change', function (event) {
    const detail = event.detail,
        oldValue = detail.oldValue,
        task = detail.task,
        value = detail.value;

	// event handling code goes here.
})

closeCustomEvent

This event is triggered when the edit/prompt dialog is closed.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onClose

Arguments

evCustomEvent

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of close event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('close', function (event) {
	// event handling code goes here.
})

closingCustomEvent

This event is triggered when the edit/prompt dialog is about to be closed. The closing operation can be canceled by calling event.preventDefault() in the event handler function.

  • Bubbles Yes
  • Cancelable Yes
  • Interface CustomEvent
  • Event handler property onClosing

Arguments

evCustomEvent

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of closing event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('closing', function (event) {
	// event handling code goes here.
})

columnAddCustomEvent

This event is triggered when a column is added.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onColumnAdd

Arguments

evCustomEvent
ev.detailObject
ev.detail.label - The column label.
ev.detail.dataField - The column data field.
ev.detail.collapsed - The column's collapsed state.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of columnAdd event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('columnAdd', function (event) {
    const detail = event.detail,
        label = detail.label,
        dataField = detail.dataField,
        collapsed = detail.collapsed;

	// event handling code goes here.
})

columnRemoveCustomEvent

This event is triggered when a column is removed.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onColumnRemove

Arguments

evCustomEvent
ev.detailObject
ev.detail.label - The column label.
ev.detail.dataField - The column data field.
ev.detail.collapsed - The column's collapsed state.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of columnRemove event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('columnRemove', function (event) {
    const detail = event.detail,
        label = detail.label,
        dataField = detail.dataField,
        collapsed = detail.collapsed;

	// event handling code goes here.
})

columnReorderCustomEvent

This event is triggered when a column is reordered.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onColumnReorder

Arguments

evCustomEvent
ev.detailObject
ev.detail.oldIndex - The column's old index.
ev.detail.index - The column's new index.
ev.detail.column - The column's data object with 'label', 'dataField' and 'collapsed' fields.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of columnReorder event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('columnReorder', function (event) {
    const detail = event.detail,
        oldIndex = detail.oldIndex,
        index = detail.index,
        column = detail.column;

	// event handling code goes here.
})

columnUpdateCustomEvent

This event is triggered when a column is updated.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onColumnUpdate

Arguments

evCustomEvent
ev.detailObject
ev.detail.oldValue - The column's old label.
ev.detail.value - The column's new label.
ev.detail.column - The column's data object with 'label', 'dataField' and 'collapsed' fields.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of columnUpdate event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('columnUpdate', function (event) {
    const detail = event.detail,
        oldValue = detail.oldValue,
        value = detail.value,
        column = detail.column;

	// event handling code goes here.
})

columnClickCustomEvent

This event is triggered when a column header is clicked.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onColumnClick

Arguments

evCustomEvent
ev.detailObject
ev.detail.label - The column label.
ev.detail.dataField - The column data field.
ev.detail.collapsed - The column's collapsed state.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of columnClick event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('columnClick', function (event) {
    const detail = event.detail,
        label = detail.label,
        dataField = detail.dataField,
        collapsed = detail.collapsed;

	// event handling code goes here.
})

columnDoubleClickCustomEvent

This event is triggered when a column header is double clicked.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onColumnDoubleClick

Arguments

evCustomEvent
ev.detailObject
ev.detail.label - The column label.
ev.detail.dataField - The column data field.
ev.detail.collapsed - The column's collapsed state.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of columnDoubleClick event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('columnDoubleClick', function (event) {
    const detail = event.detail,
        label = detail.label,
        dataField = detail.dataField,
        collapsed = detail.collapsed;

	// event handling code goes here.
})

columnShowCustomEvent

This event is triggered when a column is shown by using the column's action menu or the Kanban's 'show' method.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onColumnShow

Arguments

evCustomEvent
ev.detailObject
ev.detail.label - The column label.
ev.detail.dataField - The column data field.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of columnShow event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('columnShow', function (event) {
    const detail = event.detail,
        label = detail.label,
        dataField = detail.dataField;

	// event handling code goes here.
})

columnHideCustomEvent

This event is triggered when a column is hidden by using the column's action menu or the Kanban's 'hide' method.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onColumnHide

Arguments

evCustomEvent
ev.detailObject
ev.detail.label - The column label.
ev.detail.dataField - The column data field.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of columnHide event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('columnHide', function (event) {
    const detail = event.detail,
        label = detail.label,
        dataField = detail.dataField;

	// event handling code goes here.
})

columnCollapseCustomEvent

This event is triggered when a column is collapsed by using the column's action menu or the Kanban's 'collapse' method.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onColumnCollapse

Arguments

evCustomEvent
ev.detailObject
ev.detail.label - The column label.
ev.detail.dataField - The column data field.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of columnCollapse event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('columnCollapse', function (event) {
    const detail = event.detail,
        label = detail.label,
        dataField = detail.dataField;

	// event handling code goes here.
})

columnExpandCustomEvent

This event is triggered when a column is expanded by using the column's action menu or the Kanban's 'expand' method.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onColumnExpand

Arguments

evCustomEvent
ev.detailObject
ev.detail.label - The column label.
ev.detail.dataField - The column data field.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of columnExpand event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('columnExpand', function (event) {
    const detail = event.detail,
        label = detail.label,
        dataField = detail.dataField;

	// event handling code goes here.
})

commentAddCustomEvent

This event is triggered when a comment is added to the Kanban Task.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onCommentAdd

Arguments

evCustomEvent
ev.detailObject
ev.detail.id - The task's id.
ev.detail.value - The comment object. It has 'text: string, time: Date and userId:number' properties.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of commentAdd event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('commentAdd', function (event) {
    const detail = event.detail,
        id = detail.id,
        value = detail.value;

	// event handling code goes here.
})

commentRemoveCustomEvent

This event is triggered when a comment is removed from the Kanban Task.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onCommentRemove

Arguments

evCustomEvent
ev.detailObject
ev.detail.id - The task's id.
ev.detail.value - The comment object. It has 'text: string, time: Date and userId:number' properties.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of commentRemove event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('commentRemove', function (event) {
    const detail = event.detail,
        id = detail.id,
        value = detail.value;

	// event handling code goes here.
})

commentUpdateCustomEvent

This event is triggered when a comment is updated in the Kanban Task.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onCommentUpdate

Arguments

evCustomEvent
ev.detailObject
ev.detail.id - The task's id.
ev.detail.value - The comment object. It has 'text: string, time: Date and userId:number' properties.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of commentUpdate event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('commentUpdate', function (event) {
    const detail = event.detail,
        id = detail.id,
        value = detail.value;

	// event handling code goes here.
})

dragEndCustomEvent

This event is triggered when a task is dropped somewhere in the DOM. The dragging operation can be canceled by calling event.preventDefault() in the event handler function.

  • Bubbles Yes
  • Cancelable Yes
  • Interface CustomEvent
  • Event handler property onDragEnd

Arguments

evCustomEvent
ev.detailObject
ev.detail.container - the Kanban the dragged task(s) is dropped to
ev.detail.data - an object with additional drag details
ev.detail.item - the task that is dragged; if multiple tasks are dragged, this is the task that has been clicked when initiating the drag operation
ev.detail.items - an array with all dragged tasks
ev.detail.originalEvent - the original, browser, event that initiates the drag operation
ev.detail.previousContainer - the Kanban the dragged item(s) is dragged from
ev.detail.target - the element the dragged tasks are dropped to

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of dragEnd event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('dragEnd', function (event) {
    const detail = event.detail,
        container = detail.container,
        data = detail.data,
        item = detail.item,
        items = detail.items,
        originalEvent = detail.originalEvent,
        previousContainer = detail.previousContainer,
        target = detail.target;

	// event handling code goes here.
})

draggingCustomEvent

This event is triggered when the user is dragging a task.

  • Bubbles Yes
  • Cancelable Yes
  • Interface CustomEvent
  • Event handler property onDragging

Arguments

evCustomEvent
ev.detailObject
ev.detail.data - an object with additional drag details
ev.detail.item - the task that is dragged; if multiple tasks are dragged, this is the task that has been clicked when initiating the drag operation
ev.detail.items - an array with all dragged tasks
ev.detail.originalEvent - the original, browser, event that initiates the drag operation

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of dragging event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('dragging', function (event) {
    const detail = event.detail,
        data = detail.data,
        item = detail.item,
        items = detail.items,
        originalEvent = detail.originalEvent;

	// event handling code goes here.
})

dragStartCustomEvent

This event is triggered when the user starts dragging task(s). The dragging operation can be canceled by calling event.preventDefault() in the event handler function.

  • Bubbles Yes
  • Cancelable Yes
  • Interface CustomEvent
  • Event handler property onDragStart

Arguments

evCustomEvent
ev.detailObject
ev.detail.container - the Kanban the dragged task(s) is dragged from
ev.detail.data - an object with additional drag details
ev.detail.item - the task that is dragged; if multiple tasks are dragged, this is the task that has been clicked when initiating the drag operation
ev.detail.items - an array with all dragged tasks
ev.detail.originalEvent - the original, browser, event that initiates the drag operation
ev.detail.previousContainer - the Kanban the dragged item(s) is dragged from

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of dragStart event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('dragStart', function (event) {
    const detail = event.detail,
        container = detail.container,
        data = detail.data,
        item = detail.item,
        items = detail.items,
        originalEvent = detail.originalEvent,
        previousContainer = detail.previousContainer;

	// event handling code goes here.
})

filterCustomEvent

This event is triggered when a filter has been applied.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onFilter

Arguments

evCustomEvent

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of filter event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('filter', function (event) {
	// event handling code goes here.
})

openCustomEvent

This event is triggered when the edit/prompt dialog is opened.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onOpen

Arguments

evCustomEvent

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of open event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('open', function (event) {
	// event handling code goes here.
})

openingCustomEvent

This event is triggered when the edit/prompt dialog is about to be opened. The opening operation can be canceled by calling event.preventDefault() in the event handler function. If you want to cancel the default Kanban dialog, call event.preventDefault();

  • Bubbles Yes
  • Cancelable Yes
  • Interface CustomEvent
  • Event handler property onOpening

Arguments

evCustomEvent
ev.detailObject
ev.detail.comment - The comment that is about to be removed (if applicable).
ev.detail.purpose - The purpose of the dialog to be opened - 'edit' or 'prompt'.
ev.detail.task - The task that is about to be edited or removed (if applicable).

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of opening event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('opening', function (event) {
    const detail = event.detail,
        comment = detail.comment,
        purpose = detail.purpose,
        task = detail.task;

	// event handling code goes here.
})

sortCustomEvent

This event is triggered when sorting has been applied.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onSort

Arguments

evCustomEvent

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of sort event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('sort', function (event) {
	// event handling code goes here.
})

taskBeforeAddCustomEvent

This event is triggered before a new task is added. You can use the event.detail.value and event.detail.id to customize the new Task before adding it to the Kanban. Example: kanban.onTaskBeforeAdd = (event) => { const data = event.detail.value; const id = event.detail.id; event.detail.id = 'BG12';}

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onTaskBeforeAdd

Arguments

evCustomEvent
ev.detailObject
ev.detail.value - The task data that is added to the Kanban.
ev.detail.id - The task data id.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of taskBeforeAdd event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('taskBeforeAdd', function (event) {
    const detail = event.detail,
        value = detail.value,
        id = detail.id;

	// event handling code goes here.
})

taskAddCustomEvent

This event is triggered when a new task is added. Example: kanban.onTaskAdd = (event) => { const data = event.detail.value; const id = event.detail.id; }

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onTaskAdd

Arguments

evCustomEvent
ev.detailObject
ev.detail.value - The task data that is added to the Kanban.
ev.detail.id - The task data id.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of taskAdd event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('taskAdd', function (event) {
    const detail = event.detail,
        value = detail.value,
        id = detail.id;

	// event handling code goes here.
})

taskRemoveCustomEvent

This event is triggered when a task is removed.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onTaskRemove

Arguments

evCustomEvent
ev.detailObject
ev.detail.value - The task data that is removed from the Kanban.
ev.detail.id - The task data id.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of taskRemove event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('taskRemove', function (event) {
    const detail = event.detail,
        value = detail.value,
        id = detail.id;

	// event handling code goes here.
})

taskUpdateCustomEvent

This event is triggered when a task is updated.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onTaskUpdate

Arguments

evCustomEvent
ev.detailObject
ev.detail.value - The task data that is updated.
ev.detail.oldValue - The update task's old data.
ev.detail.id - The task data id.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of taskUpdate event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('taskUpdate', function (event) {
    const detail = event.detail,
        value = detail.value,
        oldValue = detail.oldValue,
        id = detail.id;

	// event handling code goes here.
})

taskClickCustomEvent

This event is triggered when a task is clicked.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onTaskClick

Arguments

evCustomEvent
ev.detailObject
ev.detail.value - The task data.
ev.detail.id - The task data id.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of taskClick event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('taskClick', function (event) {
    const detail = event.detail,
        value = detail.value,
        id = detail.id;

	// event handling code goes here.
})

taskDoubleClickCustomEvent

This event is triggered when a task is double clicked.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onTaskDoubleClick

Arguments

evCustomEvent
ev.detailObject
ev.detail.value - The task data.
ev.detail.id - The task data id.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of taskDoubleClick event.

const kanban = document.querySelector('smart-kanban');
kanban.addEventListener('taskDoubleClick', function (event) {
    const detail = event.detail,
        value = detail.value,
        id = detail.id;

	// event handling code goes here.
})

Methods

addFilter( filters: any, operator?: string): void

Adds filtering. Example: const filterGroup = new Smart.FilterGroup(); const filterObject = filterGroup.createFilter('string', 'Italy', 'contains'); filterGroup.addFilter('and', filterObject); kanban.addFilter([['Country', filterGroup]]);

Arguments

filtersany

Filter information. Example: kanban.addFilter([['Country', filterGroup]]);. Each array item is a sub array with two items - 'dataField' and 'filterGroup' object. The 'dataField' is any valid data field from the data source bound to the Kanban like 'dueDate', 'startDate' or custom fields like 'Country'. Filter conditions which you can use in the expressions: '=', 'EQUAL','<>', 'NOT_EQUAL', '!=', '<', 'LESS_THAN','>', 'GREATER_THAN', '<=', 'LESS_THAN_OR_EQUAL', '>=', 'GREATER_THAN_OR_EQUAL','starts with', 'STARTS_WITH','ends with', 'ENDS_WITH', '', 'EMPTY', 'CONTAINS','DOES_NOT_CONTAIN', 'NULL','NOT_NULL'

operator?string

Logical operator between the filters of different fields. Possible values are: 'and', 'or'.


Invoke the addFilter method.

const kanban = document.querySelector('smart-kanban');
kanban.addFilter("[['firstName', filterGroup]], 'and'");

addSort( dataFields: [] | string, orderBy: [] | string): void

Adds sorting. Example: kanban.addSort(['Country'], 'ascending');

Arguments

dataFields[] | string

The data field(s) to sort by

orderBy[] | string

The sort direction(s) to sort the data field(s) by. Possible values are: 'ascending' and 'descending'.


Invoke the addSort method.

const kanban = document.querySelector('smart-kanban');
kanban.addSort(["firstName","country"],"ascending");

addTask( data?: any): void

Adds a task to a Kanban column. If no data is specified, an empty task is added to the first column.

Arguments

data?any

An object containing the new task's data


Invoke the addTask method.

const kanban = document.querySelector('smart-kanban');
kanban.addTask({"id":18,"text":"New task","status":"toDo","tags":"new, delayed"});

addColumn( data?: any): void

Adds a column to a Kanban. If no data is specified, an empty column is added.

Arguments

data?any

An object containing the new column's data


Invoke the addColumn method.

const kanban = document.querySelector('smart-kanban');
kanban.addColumn({"dataField":"toDoNew","label":"New column"});

beginEdit( task: number | string | HTMLElement): void

Begins an edit operation

Arguments

tasknumber | string | HTMLElement

The task's id or corresponding HTMLElement


Invoke the beginEdit method.

const kanban = document.querySelector('smart-kanban');
kanban.beginEdit(8);

cancelEdit(): void

Ends the current edit operation and discards changes


Invoke the cancelEdit method.

const kanban = document.querySelector('smart-kanban');
kanban.cancelEdit();

closePanel(): void

Closes any open header panel (drop down)


Invoke the closePanel method.

const kanban = document.querySelector('smart-kanban');
kanban.closePanel();

collapse( column: number | string): void

Collapses a Kanban column.

Arguments

columnnumber | string

The index or dataField of the column to collapse


Invoke the collapse method.

const kanban = document.querySelector('smart-kanban');
kanban.collapse("done");

clearSelection(): void

Clears the Kanban's selection.


Invoke the clearSelection method.

const kanban = document.querySelector('smart-kanban');
kanban.clearSelection();

hide( column: number | string): void

Hides a Kanban column.

Arguments

columnnumber | string

The index or dataField of the column to hide


Invoke the hide method.

const kanban = document.querySelector('smart-kanban');
kanban.hide("done");

copyTask( task: number | string | HTMLElement): void

Creates a copy of a task in the same column.

Arguments

tasknumber | string | HTMLElement

The task's id or corresponding HTMLElement


Invoke the copyTask method.

const kanban = document.querySelector('smart-kanban');
kanban.copyTask(1);

endEdit(): void

Ends the current edit operation and saves changes


Invoke the endEdit method.

const kanban = document.querySelector('smart-kanban');
kanban.endEdit();

ensureVisible( task: number | string | HTMLElement): HTMLElement

Makes sure a task is visible by scrolling to it. If succcessful, the method returns the HTML element of the task.

Arguments

tasknumber | string | HTMLElement

The task's id or corresponding HTMLElement

ReturnsHTMLElement

Invoke the ensureVisible method.

const kanban = document.querySelector('smart-kanban');
const result = kanban.ensureVisible(5);

expand( column: number | string): void

Expands a Kanban column.

Arguments

columnnumber | string

The index or dataField of the column to expand


Invoke the expand method.

const kanban = document.querySelector('smart-kanban');
kanban.expand("done");

expandAll(): void

Expands all Kanban columns.


Invoke the expandAll method.

const kanban = document.querySelector('smart-kanban');
kanban.expandAll("done");

exportData( dataFormat: string, fileName: string, callback?: Function): any

Exports the Kanban's data.

Arguments

dataFormatstring

The file format to export to. Supported formats: 'csv', 'html', 'json', 'pdf', 'tsv', 'xlsx', 'xml'.

fileNamestring

The name of the file to export to

callback?Function

A callback function to pass the exported data to (if fileName is not provided)

Returnsany

Invoke the exportData method.

const kanban = document.querySelector('smart-kanban');
const result = kanban.exportData("html","my-kanban");

getColumn( dataField: string): any

Gets the data of a column. The returned value is a JSON object with the following fields: 'label', 'dataField', 'collapsed', 'collapsible', 'allowRemove', 'editable', 'reorder', 'orientation'.

Arguments

dataFieldstring

The column's data field

Returnsany

Invoke the getColumn method.

const kanban = document.querySelector('smart-kanban');
const result = kanban.getColumn("toDo");

getTask( id: number): any

Gets the data of a task. The returned value is a JSON object with the following fields: 'checklist', 'id', 'color', 'comments', 'history', 'dueDate', 'startDate', 'priority', 'progress', 'status', 'swimlane', 'tags', 'text', 'description', 'userId', 'createdUserId', 'createdDate', 'updatedUserId', 'updatedDate'

Arguments

idnumber

The task's id

Returnsany

Invoke the getTask method.

const kanban = document.querySelector('smart-kanban');
const result = kanban.getTask("2");

getSelectedTasks( id: number): any

Gets the selected ids. The returned value is an array. Each item in the array is the 'id' of a selected task.

Arguments

idnumber

The task's id

Returnsany

Invoke the getSelectedTasks method.

const kanban = document.querySelector('smart-kanban');
const result = kanban.getSelectedTasks();

getState(): any

Gets the Kanban's state. Returns an object with the following type: { collapsed: {}, dataSource: [], filtering: { filters: [], operator: string }, selection: { selected: [], selectionStart?: number | string, selectionInColumn: string, swimlane: string }, sorting: { dataFields: [], dataTypes: [], orderBy: [] }, tabs: [], visibility: { taskActions: boolean, taskComments: boolean, taskDue: boolean, taskPriority: boolean, taskProgress: boolean, taskTags: boolean, taskUserIcon: boolean } }

Returnsany

Invoke the getState method.

const kanban = document.querySelector('smart-kanban');
const result = kanban.getState();

loadState( state?: { collapsed: {}, dataSource: [], filtering: { filters: [], operator: string }, selection: { selected: [], selectionStart?: number | string, selectionInColumn: string, swimlane: string }, sorting: { dataFields: [], dataTypes: [], orderBy: [] }, tabs: [], visibility: { taskActions: boolean, taskComments: boolean, taskDue: boolean, taskPriority: boolean, taskProgress: boolean, taskTags: boolean, taskUserIcon: boolean } }): void

Loads the Kanban's state.

Arguments

state?{ collapsed: {}, dataSource: [], filtering: { filters: [], operator: string }, selection: { selected: [], selectionStart?: number | string, selectionInColumn: string, swimlane: string }, sorting: { dataFields: [], dataTypes: [], orderBy: [] }, tabs: [], visibility: { taskActions: boolean, taskComments: boolean, taskDue: boolean, taskPriority: boolean, taskProgress: boolean, taskTags: boolean, taskUserIcon: boolean } }

An object returned by one of the methods getState or saveState. If not passed, gets saved state from the browser's localStorage.


Invoke the loadState method.

const kanban = document.querySelector('smart-kanban');
kanban.loadState();

moveTask( task: number | string | HTMLElement, newStatus: string): void

Moves a task to a different column.

Arguments

tasknumber | string | HTMLElement

The task's id or corresponding HTMLElement

newStatusstring

The new status of the task (its new column's dataField)


Invoke the moveTask method.

const kanban = document.querySelector('smart-kanban');
kanban.moveTask(11);

openCustomizePanel(): void

Opens the "Customize tasks" header panel (drop down)


Invoke the openCustomizePanel method.

const kanban = document.querySelector('smart-kanban');
kanban.openCustomizePanel();

openFilterPanel(): void

Opens the "Filter" header panel (drop down)


Invoke the openFilterPanel method.

const kanban = document.querySelector('smart-kanban');
kanban.openFilterPanel();

openSortPanel(): void

Opens the "Sort" header panel (drop down)


Invoke the openSortPanel method.

const kanban = document.querySelector('smart-kanban');
kanban.openSortPanel();

removeFilter(): void

Removes filtering


Invoke the removeFilter method.

const kanban = document.querySelector('smart-kanban');
kanban.removeFilter();

removeSort(): void

Removes sorting


Invoke the removeSort method.

const kanban = document.querySelector('smart-kanban');
kanban.removeSort();

removeTask( task: number | string | HTMLElement, prompt?: boolean): void

Removes a task.

Arguments

tasknumber | string | HTMLElement

The task's id or corresponding HTMLElement

prompt?boolean

Whether or not to prompt the user before removing the task


Invoke the removeTask method.

const kanban = document.querySelector('smart-kanban');
kanban.removeTask(2);

removeColumn( dataField: string): void

Removes a column.

Arguments

dataFieldstring

The column's data field


Invoke the removeColumn method.

const kanban = document.querySelector('smart-kanban');
kanban.removeColumn("toDo");

saveState(): void

Saves the Kanban's state to the browser's localStorage.


Invoke the saveState method.

const kanban = document.querySelector('smart-kanban');
kanban.saveState();

show( column: number | string): void

Shows a Kanban column.

Arguments

columnnumber | string

The index or dataField of the column to show


Invoke the show method.

const kanban = document.querySelector('smart-kanban');
kanban.show("done");

showAllColumns(): void

Shows all Kanban columns.


Invoke the showAllColumns method.

const kanban = document.querySelector('smart-kanban');
kanban.showAllColumns();

selectTask( task: number | string): void

Selects a task.

Arguments

tasknumber | string

The task's id.


Invoke the selectTask method.

const kanban = document.querySelector('smart-kanban');
kanban.selectTask(2);

unselectTask( task: number | string): void

Unselects a task.

Arguments

tasknumber | string

The task's id.


Invoke the unselectTask method.

const kanban = document.querySelector('smart-kanban');
kanban.unselectTask(2);

updateTask( task: number | string | HTMLElement, newData: {}): void

Updates a task.

Arguments

tasknumber | string | HTMLElement

The task's id or corresponding HTMLElement

newData{}

The new data to visualize in the task.


Invoke the updateTask method.

const kanban = document.querySelector('smart-kanban');
kanban.updateTask(2);

updateColumn( dataField: string, newData: {}): void

Updates a column.

Arguments

dataFieldstring

The new column's data field

newData{}

The new data to visualize in the column.


Invoke the updateColumn method.

const kanban = document.querySelector('smart-kanban');
kanban.updateColumn("toDo");

CSS Variables

--smart-kanban-default-widthvar()

Default value

"1200px"

Default width of Kanban

--smart-kanban-default-heightvar()

Default value

"500px"

Default height of Kanban

--smart-kanban-header-sizevar()

Default value

"35px"

Header size of Kanban (applies to header and column headers)

--smart-kanban-task-min-widthvar()

Default value

"150px"

Min width for Kanban tasks in columns with horizontal orientation

--smart-kanban-task-min-heightvar()

Default value

"80px"

Kanban task min height

--smart-kanban-text-max-heightvar()

Default value

"200px"

Kanban task text part max height

--smart-kanban-user-icon-sizevar()

Default value

"30px"

Kanban user icon size

--smart-kanban-user-list-widthvar()

Default value

"150px"

Kanban user list width

--smart-kanban-user-list-max-heightvar()

Default value

"400px"

Kanban user list max height

--smart-kanban-comments-list-widthvar()

Default value

"350px"

Kanban comments list width

--smart-kanban-comments-list-heightvar()

Default value

"400px"

Kanban comments list height

--smart-kanban-new-comment-heightvar()

Default value

"50px"

Height of new comment section

--smart-kanban-new-comment-height-expandedvar()

Default value

"175px"

Expanded height of new comment section

--smart-kanban-send-button-heightvar()

Default value

"30px"

Height of Send button in new comment section

--smart-kanban-color-band-widthvar()

Default value

"3px"

Kanban color band width (i.e. left border of tasks)

--smart-data-view-paddingvar()

Default value

"10px"

Padding of the CardView and Kanban

--smart-data-view-customize-panel-widthvar()

Default value

"200px"

Width of the CardView and Kanban customize panel (drop down).

--smart-data-view-filter-panel-widthvar()

Default value

"550px"

Width of the CardView and Kanban filter panel (drop down).

--smart-data-view-sort-panel-widthvar()

Default value

"400px"

Width of the CardView and Kanban sort panel (drop down).

--smart-data-view-search-panel-widthvar()

Default value

"250px"

Width of the CardView and Kanban search panel (drop down).

--smart-kanban-add-new-column-widthvar()

Default value

"1fr"

Kanban "+ New status" column width.