Search results

Breadcrumb

Breadcrumb is a graphical user interface that helps to identify or highlight the current location within a hierarchical structure of websites. The aim is to make the user aware of their current position in a hierarchy of website links.

<nav id='breadcrumb'></nav>
<script>
var breadcrumbObj = new Breadcrumb({ items: [{ text: 'Home', url: '/' }, { text: 'Index', url: './index.html }]});
breadcrumbObj.appendTo("#breadcrumb");
</script>

Properties

activeItem

string

Specifies the Url of the active Breadcrumb item.

Defaults to

cssClass

string

Defines class/multiple classes separated by a space in the Breadcrumb element.

Defaults to

enableActiveItemNavigation

boolean

Enable or disable the active item navigation, when set to true, active item will be navigable.

Defaults to false

enableNavigation

boolean

Enable or disable the item’s navigation, when set to false, each item navigation will be prevented.

Defaults to true

enablePersistence

boolean

Enable or disable persisting component’s state between page reloads.

Defaults to false

enableRtl

boolean

Enable or disable rendering component in right to left direction.

Defaults to false

itemTemplate

string

Specifies the template for Breadcrumb item.

Defaults to null

items

BreadcrumbItemModel[]

Defines the list of Breadcrumb items.

Defaults to []

maxItems

number

Specifies an integer to enable overflow behavior when the Breadcrumb items count exceeds and it is based on the overflowMode property.

Defaults to 0

overflowMode

string

Specifies the overflow mode of the Breadcrumb item when it exceeds maxItems count. The possible values are,

  • Default: Specified maxItems count will be visible and the remaining items will be hidden. While clicking on the previous item, the hidden item will become visible.
  • Collapsed: Only the first and last items will be visible, and the remaining items will be hidden in the collapsed icon. When the collapsed icon is clicked, all items become visible.

Defaults to ‘Default’

separatorTemplate

string

Specifies the separator template for Breadcrumb.

Defaults to ’/’

url

string

Defines the Url based on which the Breadcrumb items are generated.

Defaults to

width

string

Specifies the width for the Breadcrumb component container element. If the Breadcrumb items overflow, the browsers horizontal scroll will be activated based on the device.

Defaults to

Methods

addEventListener

Adds the handler to the given event listener.

Parameter Type Description
eventName string A String that specifies the name of the event
handler Function Specifies the call to run when the event occurs.

Returns void

appendTo

Appends the control within the given HTML element

Parameter Type Description
selector (optional) string | HTMLElement Target element where control needs to be appended

Returns void

dataBind

When invoked, applies the pending property changes immediately to the component.

Returns void

destroy

Destroys the widget.

Returns void

getLocalData

Returns the persistence data for component

Returns any

getRootElement

Returns the route element of the component

Returns HTMLElement

refresh

Applies all the pending property changes and render the component again.

Returns void

removeEventListener

Removes the handler from the given event listener.

Parameter Type Description
eventName string A String that specifies the name of the event to remove
handler Function Specifies the function to remove

Returns void

Inject

Dynamically injects the required modules to the component.

Parameter Type Description
moduleList Function[] ?

Returns void

Events

beforeItemRender

EmitType<BreadcrumbBeforeItemRenderEventArgs>

Triggers while rendering each breadcrumb item.

created

EmitType<Event>

Triggers once the component rendering is completed.

itemClick

EmitType<BreadcrumbClickEventArgs>

Triggers while clicking the breadcrumb item.