Angular and Ionic Treelist
Treelist for Angular and Ionic 2/3/4
Treelist for Angular and Ionic 2/3/4
Treelist for Angular and Ionic 2/3/4
Hierarchical list scroller component to help navigate lists with variable depth.
Compatible with mobiscroll forms, custom inputs and more. Use it on any touch screen, no matter if small or large.
Shipping with useful features for a refined UX, including:
- Single select mode
- Hierarchy with variable depth
- Disabled values for restricting selection
- Circular wheels
- Multiple theme support
- Modal, popup and inline display mores
- RTL Support
- Full localization
Interested in scroller controls? Other demos that could be useful:
Treelist demos available for other frameworks.
Viewing demos & code for
Treelist - Unordered list
@Component({
selector: 'demo-app',
templateUrl: './app.component.html'
})
export class AppComponent {
listSettings: any = {
theme: '',
lang: '',
width: 200,
placeholder: 'Please Select ...'
}
}
<ul mbsc-treelist [(ngModel)]="myItem" [mbsc-options]="listSettings" placeholder="Please Select...">
<li>Sugar</li>
<li>Salt</li>
<li>Butter</li>
<li>Flour</li>
<li>Chocolate</li>
</ul>
Treelist - Ordered list
@Component({
selector: 'demo-app',
templateUrl: './app.component.html'
})
export class AppComponent {
listSettings: any = {
lang: '',
theme: '',
display: 'bottom',
placeholder: 'Please Select ...',
labels: ['Country', 'Medals'],
showLabel: true
}
}
<ol mbsc-treelist [(ngModel)]="myItem" [mbsc-options]="listSettings"placeholder="Please Select...">
<li>USA
<ol>
<li>104</li>
</ol>
</li>
<li>China
<ol>
<li>88</li>
</ol>
</li>
<li>Russia
<ol>
<li>82</li>
</ol>
</li>
<li>Great Britain
<ol>
<li>65</li>
</ol>
</li>
<li>Germany
<ol>
<li>44</li>
</ol>
</li>
</ol>
Treelist - Event handlers
EVENTS FIRED:
@Component({
selector: 'demo-app',
templateUrl: './app.component.html'
})
export class AppComponent {
listSettings: any = {
theme: '',
lang: '',
width: 200,
placeholder: 'Please Select ...',
labels: ['Ingredients'],
onInit: function (event, inst) {
// Your custom event handler goes here
},
onMarkupReady: function (event, inst) {
// Your custom event handler goes here
},
onBeforeShow: function (event, inst) {
// Your custom event handler goes here
},
onPosition: function (event, inst) {
// Your custom event handler goes here
},
onShow: function (event, inst) {
// Your custom event handler goes here
},
onSet: function (event, inst) {
// Your custom event handler goes here
},
onItemTap: function (event, inst) {
// Your custom event handler goes here
},
onDestroy: function (event, inst) {
// Your custom event handler goes here
},
onClose: function (event, inst) {
// Your custom event handler goes here
},
onChange: function (event, inst) {
// Your custom event handler goes here
},
onCancel: function (event, inst) {
// Your custom event handler goes here
},
onBeforeClose: function (event, inst) {
// Your custom event handler goes here
},
onClear: function (event, inst) {
// Your custom event handler goes here
}
};
}
<ul mbsc-treelist [(ngModel)]="myItem" [mbsc-options]="listSettings"placeholder="Please Select...">
<li>Sugar</li>
<li>Salt</li>
<li>Butter</li>
<li>Flour</li>
<li>Chocolate</li>
</ul>
Treelist - Display modes
import { mobiscroll, MbscTreelistOptions, MbscForm } from '@mobiscroll/angular';
import { ViewChild } from '@angular/core';
mobiscroll.settings = {
lang: '',
theme: ''
};
@Component({
selector: 'demo-app',
templateUrl: './app.component.html'
})
export class AppComponent {
@ViewChild('mbscForm') form: MbscForm;
refreshForm() {
if (this.form.instance) {
this.form.instance.refresh();
}
}
listSettings: MbscTreelistOptions = {
display: 'bottom',
onInit: (event, inst) => {
this.refreshForm();
}
}
listTopSettings: MbscTreelistOptions = {
display: 'top',
onInit: (event, inst) => {
this.refreshForm();
}
}
listCenterSettings: MbscTreelistOptions = {
display: 'center',
onInit: (event, inst) => {
this.refreshForm();
}
}
listBubbleSettings: MbscTreelistOptions = {
display: 'bubble',
onInit: (event, inst) => {
this.refreshForm();
}
}
listInlineSettings: MbscTreelistOptions = {
display: 'inline',
layout: 'liquid',
showInput: false,
onInit: (event, inst) => {
this.refreshForm();
}
}
}
<mbsc-form #mbscForm="mobiscroll">
<mbsc-form-group>
<mbsc-form-group-title>Try different display modes</mbsc-form-group-title>
<label>
Bottom
<ul mbsc-treelist [(ngModel)]="bottomList" [mbsc-options]="listSettings" placeholder="Please Select ...">
<li data-val="America">America
<ul>
<li data-val="Mexico">Mexico</li>
<li data-val="Brasil">Brasil</li>
</ul>
</li>
<li data-val="Europe">Europe
<ul>
<li data-val="Germany">Germany</li>
<li data-val="France">France</li>
<li data-val="Italy">Italy</li>
</ul>
</li>
<li data-val="Asia">Asia
<ul>
<li data-val="China">China</li>
</ul>
</li>
</ul>
</label>
<label>
Top
<ul mbsc-treelist [(ngModel)]="topList" [mbsc-options]="listTopSettings" placeholder="Please Select ...">
<li data-val="America">America
<ul>
<li data-val="Mexico">Mexico</li>
<li data-val="Brasil">Brasil</li>
</ul>
</li>
<li data-val="Europe">Europe
<ul>
<li data-val="Germany">Germany</li>
<li data-val="France">France</li>
<li data-val="Italy">Italy</li>
</ul>
</li>
<li data-val="Asia">Asia
<ul>
<li data-val="China">China</li>
</ul>
</li>
</ul>
</label>
<label>
Center
<ul mbsc-treelist [(ngModel)]="centerList" [mbsc-options]="listCenterSettings" placeholder="Please Select ...">
<li data-val="America">America
<ul>
<li data-val="Mexico">Mexico</li>
<li data-val="Brasil">Brasil</li>
</ul>
</li>
<li data-val="Europe">Europe
<ul>
<li data-val="Germany">Germany</li>
<li data-val="France">France</li>
<li data-val="Italy">Italy</li>
</ul>
</li>
<li data-val="Asia">Asia
<ul>
<li data-val="China">China</li>
</ul>
</li>
</ul>
</label>
<label>
Bubble
<ul mbsc-treelist [(ngModel)]="bubbleList" [mbsc-options]="listBubbleSettings" placeholder="Please Select ...">
<li data-val="America">America
<ul>
<li data-val="Mexico">Mexico</li>
<li data-val="Brasil">Brasil</li>
</ul>
</li>
<li data-val="Europe">Europe
<ul>
<li data-val="Germany">Germany</li>
<li data-val="France">France</li>
<li data-val="Italy">Italy</li>
</ul>
</li>
<li data-val="Asia">Asia
<ul>
<li data-val="China">China</li>
</ul>
</li>
</ul>
</label>
</mbsc-form-group>
<mbsc-form-group class="mbsc-padding">
<p class="mbsc-thin">With inline display you can embed the treelist component in almost any markup or form.</p>
</mbsc-form-group>
<mbsc-form-group>
<mbsc-form-group-title>Embedded treelist scroller</mbsc-form-group-title>
<ul mbsc-treelist [(ngModel)]="inlineList" [mbsc-options]="listInlineSettings">
<li data-val="America">America
<ul>
<li data-val="Mexico">Mexico</li>
<li data-val="Brasil">Brasil</li>
</ul>
</li>
<li data-val="Europe">Europe
<ul>
<li data-val="Germany">Germany</li>
<li data-val="France">France</li>
<li data-val="Italy">Italy</li>
</ul>
</li>
<li data-val="Asia">Asia
<ul>
<li data-val="China">China</li>
</ul>
</li>
</ul>
</mbsc-form-group>
</mbsc-form>
Treelist - Basic usage
@Component({
selector: 'demo-app',
templateUrl: './app.component.html'
})
export class AppComponent {
listSettings: any = {
lang: '',
theme: '',
display: 'center',
width: [156, 136, 146],
placeholder: 'Please Select ...',
labels: ['Region', 'Department', 'Tech']
}
}
<ul mbsc-treelist [(ngModel)]="myItem" [mbsc-options]="listSettings" placeholder="Please Select...">
<li data-val="Eastern Division">East Division
<ul>
<li data-val="Marketing">Marketing
<ul>
<li data-val="Eden E">Eden E</li>
<li data-val="Milda J">Milda J</li>
<li data-val="Porfirio R">Porfirio R</li>
</ul>
</li>
<li data-val="Research & Development">R&D
<ul>
<li data-val="Frances P">Frances P</li>
<li data-val="Frank D">Frank D</li>
<li data-val="Gianny P">Gianny P</li>
<li data-val="Ivan F">Ivan F</li>
<li data-val="John M">John M</li>
<li data-val="Mildred S">Mildred S</li>
<li data-val="Sam P">Sam P</li>
</ul>
</li>
<li data-val="Sales">Sales
<ul>
<li data-val="Edelmira R">Edelmira R</li>
<li data-val="Francie S">Francie S</li>
<li data-val="Lean F">Lean F</li>
<li data-val="Kirby C">Kirby C</li>
</ul>
</li>
</ul>
</li>
<li data-val="Western Division">West Division
<ul>
<li data-val="Marketing">Marketing
<ul>
<li data-val="Cliff B">Cliff B</li>
<li data-val="Helen D">Helen D</li>
<li data-val="Stephan V">Stephan V</li>
</ul>
</li>
<li data-val="Research & Development">R&D
<ul>
<li data-val="Andy G">Andy G</li>
<li data-val="Danny A">Danny A</li>
<li data-val="Ennio M">Ennio M</li>
<li data-val="Emil E">Emil E</li>
<li data-val="Frank S">Frank S</li>
<li data-val="Gonzo G">Gonzo G</li>
<li data-val="Hal A">Hal A</li>
<li data-val="Jack G">Jack G</li>
<li data-val="John A">John A</li>
<li data-val="Simon D">Simon D</li>
<li data-val="Victor S">Victor S</li>
</ul>
</li>
<li data-val="Sales">Sales
<ul>
<li data-val="Dana A">Dana A</li>
<li data-val="Frank D">Frank D</li>
<li data-val="Leanna S">Leanna S</li>
<li data-val="Michael D">Michael D</li>
</ul>
</li>
</ul>
</li>
</ul>
Treelist - Desktop
import { mobiscroll, MbscTreelistOptions } from '@mobiscroll/angular';
import { ViewChild } from '@angular/core';
mobiscroll.settings = {
lang: '',
theme: ''
};
@Component({
selector: 'demo-app',
templateUrl: './app.component.html'
})
export class AppComponent {
@ViewChild('mbscForm') form: MbscForm;
top: number;
bottom: number;
anchored: number;
center: number;
refreshForm() {
if (this.form.instance) {
this.form.instance.refresh();
}
}
topSettings: MbscTreelistOptions = {
display: 'top',
touchUi: false,
onInit: (event, inst) => {
this.refreshForm();
}
}
bottomSettings: MbscTreelistOptions = {
display: 'bottom',
touchUi: false,
onInit: (event, inst) => {
this.refreshForm();
}
}
settings: MbscTreelistOptions = {
touchUi: false,
onInit: (event, inst) => {
this.refreshForm();
}
}
centerSettings: MbscTreelistOptions = {
display: 'center',
touchUi: false,
onInit: (event, inst) => {
this.refreshForm();
}
}
}
<mbsc-form #mbscForm="mobiscroll">
<div class="mbsc-grid">
<div class="mbsc-row mbsc-justify-content-center">
<div class="mbsc-col-sm-9 mbsc-col-md-7 mbsc-col-xl-5">
<mbsc-form-group inset>
<mbsc-form-group-title>Pop-up positioning</mbsc-form-group-title>
<label>
Top
<ul mbsc-treelist [(ngModel)]="top" [mbsc-options]="topSettings" placeholder="Please Select...">
<li>Sugar</li>
<li>Salt</li>
<li>Butter</li>
<li>Flour</li>
<li>Chocolate</li>
</ul>
</label>
<label>
Bottom
<ul mbsc-treelist [(ngModel)]="bottom" [mbsc-options]="bottomSettings" placeholder="Please Select...">
<li>Sugar</li>
<li>Salt</li>
<li>Butter</li>
<li>Flour</li>
<li>Chocolate</li>
</ul>
</label>
<label>
Anchored
<ul mbsc-treelist [(ngModel)]="anchored" [mbsc-options]="settings" placeholder="Please Select...">
<li>Sugar</li>
<li>Salt</li>
<li>Butter</li>
<li>Flour</li>
<li>Chocolate</li>
</ul>
</label>
<label>
Center
<ul mbsc-treelist [(ngModel)]="center" [mbsc-options]="centerSettings" placeholder="Please Select...">
<li>Sugar</li>
<li>Salt</li>
<li>Butter</li>
<li>Flour</li>
<li>Chocolate</li>
</ul>
</label>
</mbsc-form-group>
</div>
</div>
</div>
</mbsc-form>
Treelist - Theming capabilities
import { mobiscroll, MbscTreelistOptions, MbscForm } from '@mobiscroll/angular';
import { ViewChild } from '@angular/core';
mobiscroll.settings = {
lang: '',
theme: ''
};
@Component({
selector: 'demo-app',
templateUrl: './app.component.html'
})
export class AppComponent {
@ViewChild('mbscForm') form: MbscForm;
iosDemo: number;
iosDarkDemo: number;
materialDemo: number;
materialDarkDemo: number;
windowsDemo: number;
windowsDarkDemo: number;
mobiscrollDemo: number;
mobiscrollDarkDemo: number;
refreshForm() {
if (this.form.instance) {
this.form.instance.refresh();
}
}
iosSettings: MbscTreelistOptions = {
theme: 'ios',
display: 'center',
touchUi: false,
minWidth: 200,
onInit: (event, inst) => {
this.refreshForm();
}
}
iosDarkSettings: MbscTreelistOptions = {
theme: 'ios-dark',
display: 'center',
touchUi: false,
minWidth: 200,
onInit: (event, inst) => {
this.refreshForm();
}
}
materialSettings: MbscTreelistOptions = {
theme: 'material',
display: 'center',
touchUi: false,
minWidth: 200,
onInit: (event, inst) => {
this.refreshForm();
}
}
materialDarkSettings: MbscTreelistOptions = {
theme: 'material-dark',
display: 'center',
touchUi: false,
minWidth: 200,
onInit: (event, inst) => {
this.refreshForm();
}
}
windowsSettings: MbscTreelistOptions = {
theme: 'windows',
display: 'center',
touchUi: false,
minWidth: 200,
onInit: (event, inst) => {
this.refreshForm();
}
}
windowsDarkSettings: MbscTreelistOptions = {
theme: 'windows-dark',
display: 'center',
touchUi: false,
minWidth: 200,
onInit: (event, inst) => {
this.refreshForm();
}
}
mobiscrollSettings: MbscTreelistOptions = {
theme: 'mobiscroll',
display: 'center',
touchUi: false,
minWidth: 200,
onInit: (event, inst) => {
this.refreshForm();
}
}
mobiscrollDarkSettings: MbscTreelistOptions = {
theme: 'mobiscroll-dark',
display: 'center',
touchUi: false,
minWidth: 200,
onInit: (event, inst) => {
this.refreshForm();
}
}
}
<mbsc-form #mbscForm="mobiscroll">
<div class="mbsc-grid-fixed mbsc-grid-lg">
<div class="mbsc-row">
<div class="mbsc-col">
<mbsc-form-group inset>
<mbsc-form-group-title>iOS Theme</mbsc-form-group-title>
<label>
Light
<ul mbsc-treelist [(ngModel)]="iosDemo" [mbsc-options]="iosSettings" placeholder="Please Select...">
<li>Sugar</li>
<li>Salt</li>
<li>Butter</li>
<li>Flour</li>
<li>Chocolate</li>
</ul>
</label>
<label>
Dark
<ul mbsc-treelist [(ngModel)]="iosDarkDemo" [mbsc-options]="iosDarkSettings" placeholder="Please Select...">
<li>Sugar</li>
<li>Salt</li>
<li>Butter</li>
<li>Flour</li>
<li>Chocolate</li>
</ul>
</label>
</mbsc-form-group>
</div>
<div class="mbsc-col">
<mbsc-form-group inset>
<mbsc-form-group-title>Material Theme</mbsc-form-group-title>
<label>
Light
<ul mbsc-treelist [(ngModel)]="materialDemo" [mbsc-options]="materialSettings" placeholder="Please Select...">
<li>Sugar</li>
<li>Salt</li>
<li>Butter</li>
<li>Flour</li>
<li>Chocolate</li>
</ul>
</label>
<label>
Dark
<ul mbsc-treelist [(ngModel)]="materialDarkDemo" [mbsc-options]="materialDarkSettings" placeholder="Please Select...">
<li>Sugar</li>
<li>Salt</li>
<li>Butter</li>
<li>Flour</li>
<li>Chocolate</li>
</ul>
</label>
</mbsc-form-group>
</div>
</div>
<div class="mbsc-row">
<div class="mbsc-col">
<mbsc-form-group inset>
<mbsc-form-group-title>Windows Theme</mbsc-form-group-title>
<label>
Light
<ul mbsc-treelist [(ngModel)]="windowsDemo" [mbsc-options]="windowsSettings" placeholder="Please Select...">
<li>Sugar</li>
<li>Salt</li>
<li>Butter</li>
<li>Flour</li>
<li>Chocolate</li>
</ul>
</label>
<label>
Dark
<ul mbsc-treelist [(ngModel)]="windowsDarkDemo" [mbsc-options]="windowsDarkSettings" placeholder="Please Select...">
<li>Sugar</li>
<li>Salt</li>
<li>Butter</li>
<li>Flour</li>
<li>Chocolate</li>
</ul>
</label>
</mbsc-form-group>
</div>
<div class="mbsc-col">
<mbsc-form-group inset>
<mbsc-form-group-title>Mobiscroll Theme</mbsc-form-group-title>
<label>
Light
<ul mbsc-treelist [(ngModel)]="mobiscrollDemo" [mbsc-options]="mobiscrollSettings" placeholder="Please Select...">
<li>Sugar</li>
<li>Salt</li>
<li>Butter</li>
<li>Flour</li>
<li>Chocolate</li>
</ul>
</label>
<label>
Dark
<ul mbsc-treelist [(ngModel)]="mobiscrollDarkDemo" [mbsc-options]="mobiscrollDarkSettings" placeholder="Please Select...">
<li>Sugar</li>
<li>Salt</li>
<li>Butter</li>
<li>Flour</li>
<li>Chocolate</li>
</ul>
</label>
</mbsc-form-group>
</div>
</div>
</div>
</mbsc-form>
Looking for something you didn't see or have a sales question?
Ask us about it, we're here to help.
Component license
Purchase component licenses if you are looking for specific funcionality.
All
Framework license
Get all 36 components, including
Framework license
Get all 36 components, including
- Use it when building with plain and simple JS
- Compatible with vanilla JS app or frameworks like Vue
- Royalty-free commercial usage
- Technical support is included with the license
- Use it with jQuery and jQuery Mobile
- Enjoy the familiar API if you already use jQuery
- Royalty-free commercial usage
- Technical support is included with the license
- Use it with Angular JS and Ionic 1
- For web and mobile apps based on Angular 1.x
- Royalty-free commercial usage
- Technical support is included with the license
- Use it with Angular 2/4/5/6/7 and Ionic 2/3/4
- Visual Studio and VS Code integration
- Royalty-free commercial usage
- Technical support is included with the license
- Use it when building with React JS
- Collection of UI components for web and mobile
- Royalty-free commercial usage
- Technical support is included with the license
Framework license
Select the development framework you are using. Get all 36 components with the license.
- Use it when building with plain and simple JS
- Compatible with vanilla JS app or frameworks like Vue
- Royalty-free commercial usage
- Technical support is included with the license
- Use it with jQuery and jQuery Mobile
- Enjoy the familiar API if you already use jQuery
- Royalty-free commercial usage
- Technical support is included with the license
- Use it with Angular JS and Ionic 1
- For web and mobile apps based on Angular 1.x
- Royalty-free commercial usage
- Technical support is included with the license
- Use it with Angular 2/4/5/6/7 and Ionic 2/3/4
- Visual Studio and VS Code integration
- Royalty-free commercial usage
- Technical support is included with the license
- Use it when building with React JS
- Collection of UI components for web and mobile
- Royalty-free commercial usage
- Technical support is included with the license
Select the framework you are interested in
Use Javascript when building with plain and simple JS.
Use jQuery when you have jQuery already included or if you are building with jQuery Mobile.
Use AngularJS when building with Angular 1.x or Ionic 1.
Use Angular when building with Angular 2/4/5/6/7 or Ionic 2/3/4.
Use it when you are building your app or website with React.
Do you need additional support seats?
The framework license comes with one support seat. ( +$50/seat )
Add the source code?
What framework are you using?
We have to set you up with a trial for this to run 👍
What framework are you using?
Step 1.Install the Mobiscroll CLI from npm
$ npm install -g @mobiscroll/cli
The CLI makes configuring your apps super simple 👍
Step 2.Run the following command in the root folder of your Ionic project
$ mobiscroll config ionic
$ mobiscroll config ionic --lite
You will be prompted to log in with your mobiscroll account. Set your password here
Create an Ionic 3 & Mobiscroll starter with the CLI:
Run this command for Ionic 4 & Mobiscroll starter:
Extract the zip file and run the project like any Ionic app. Make sure to have Ionic CLI installed and open the terminal in the app root folder.
$ npm install
$ ionic serve
Let us know if we can help and enjoy!
Your password has been changed!
Everything is set up so that you can dig in right away and start exploring.
We have set up a trial so that you can try the demos locally.
Extract the zip file and open the demo in your favorite browser.
To install Mobiscroll in your project
follow instructions from this page.
Let us know if we can help and enjoy! 👍
Please extract the zip file and run the project like any Angular CLI app.
Make sure to have the Angular CLI installed.
For installation and usage, extract the zip file and open a terminal window and follow these steps.
$ npm install
$ ng serve --open
Let us know if we can help and enjoy! 👍
Everything is set up so that you can dig in right away and start exploring.
We have set up a trial so that you can try the demos locally.
The easiest way to get started is to follow the installation steps and by
grabbing the code directly from the demo page. Let us know if we can help and enjoy!
You'll find a fully functional Kitchen-sink Ionic app in the zip file.
Everything is set up so that you can dig in right away and start exploring.
We have set up a trial so that you can try the demos locally.
The demos are using Babel's in-browser ES6 and JSX transformer.
Extract the zip file and open the demo in your browser. To install Mobiscroll in your project
follow instructions from this page.
Let us know if we can help and enjoy! 👍