jQuery Listview
Listview for jQuery and jQuery Mobile
Listview for jQuery and jQuery Mobile
Listview for jQuery and jQuery Mobile
Learn moreAdvanced list view component with gesture, swipe and drag & drop support.
Use it along Mobiscroll forms, pages or in any web or mobile hybrid app. Suited for small to large screens.
Shipping with useful features for a refined UX, including:
- Support for alternating row color
- Use it with single, multi-line text or custom content
- Render cards instead of full-width rows
- Enhance content with images, avatars and icons
- Built-in support for sorting and ordering
- Multiple data-source support
- Load on demand capabilities
- Top positioned sticy header for segmenting the list
- Simple to advanced grouping capabilities
- CRUD with undo functionality
- Full-blown gesture support
- Hierarchical listviews with variable depth
- Multiple theme support
Listview available for other frameworks.
Viewing demos & code for
Listview - Basic
mobiscroll.settings = {
lang: '',
theme: '',
themeVariant: ''
};
$(function () {
$('#simple').mobiscroll().listview();
$('#striped').mobiscroll().listview({
striped: true
});
});
<div mbsc-form>
<div class="mbsc-align-center">
<div class="mbsc-note mbsc-note-primary">Render a simple list of items with or without stripes.</div>
</div>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Simple list</div>
<ul id="simple" class="mbsc-cloak">
<li>The Shawshank Redemption (1994)</li>
<li>The Godfather (1972)</li>
<li>The Godfather: Part II (1974)</li>
<li>The Dark Knight (2008)</li>
<li>12 Angry Men (1957)</li>
<li>Schindler's List (1993)</li>
<li>The Lord of the Rings: The Return of the King (2003)</li>
<li>Pulp Fiction (1994)</li>
</ul>
</div>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Striped list</div>
<ul id="striped" class="mbsc-cloak">
<li>The Good, the Bad and the Ugly (1966)</li>
<li>Fight Club (1999)</li>
<li>The Lord of the Rings: The Fellowship of the Ring (2001)</li>
<li>Forrest Gump (1994)</li>
<li>Star Wars: Episode V - The Empire Strikes Back (1980)</li>
<li>Inception (2010)</li>
<li>The Lord of the Rings: The Two Towers (2002)</li>
<li>One Flew Over the Cuckoo's Nest (1975)</li>
</ul>
</div>
</div>
Listview - Content
mobiscroll.settings = {
lang: '',
theme: '',
themeVariant: ''
};
$(function () {
$('#multiline').mobiscroll().listview({
enhance: true,
swipe: false
});
$('#custom').mobiscroll().listview({
enhance: true,
swipe: false
});
$('#cards').mobiscroll().listview({
swipe: false
});
});
<div mbsc-form>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Multiline text</div>
<ul id="multiline" class="mbsc-cloak">
<li>
<h3>Electric Smartscooter</h3>
<p>Gogoro Smartscooter is world’s first connected two-wheeled electric vehicle. </p>
</li>
<li>
<h3>The Solar Bike</h3>
<p>An electric bike that incorporates solar panels and producing enough energy to use it 30 km a day.</p>
</li>
<li>
<h3>Smallest Quadricopter</h3>
<p>The Dutch gadget-manufacturer TRNDlabs reveals the smallest quadricopter of the world.</p>
</li>
<li>
<h3>Glow Headphones</h3>
<p>Discover the world’s first laser headphones that pulse to the music.</p>
</li>
</ul>
</div>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Custom CSS</div>
<ul id="custom" class="mbsc-cloak md-custom-listview">
<li>
The Intouchables (2011)
<span class="md-star-icon mbsc-ic mbsc-ic-star3">8.5</span>
</li>
<li>
The Shawshank Redemption (1994)
<span class="md-star-icon mbsc-ic mbsc-ic-star3">9.2</span>
</li>
<li>
Fight Club (1999)
<span class="md-star-icon mbsc-ic mbsc-ic-star3">8.8</span>
</li>
<li>
Inception (2010)
<span class="md-star-icon mbsc-ic mbsc-ic-star3">8.7</span>
</li>
</ul>
</div>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Cards</div>
<ul id="cards" class="mbsc-cloak mbsc-card-list">
<li mbsc-card>
<div class="mbsc-card-content">
<img src="https://img.mobiscroll.com/demos/netflix.png" draggable="false" class="mbsc-avatar">
<h5 class="mbsc-card-title mbsc-bold">Netflix</h5>
<div class="mbsc-card-subtitle">Sherlock Series 3 is now avalable on Netflix</div>
</div>
</li>
<li mbsc-card>
<div class="mbsc-card-content">
<img src="https://img.mobiscroll.com/demos/angrybirds.png" draggable="false" class="mbsc-avatar">
<h5 class="mbsc-card-title mbsc-bold">Angry birds</h5>
<div class="mbsc-card-subtitle">Don't forget your daily Arena entry.</div>
</div>
</li>
<li mbsc-card>
<div class="mbsc-card-content">
<img src="https://img.mobiscroll.com/demos/candycam.png" draggable="false" class="mbsc-avatar">
<h5 class="mbsc-card-title mbsc-bold">Candycam</h5>
<div class="mbsc-card-subtitle">A new update is available!</div>
</div>
</li>
</ul>
</div>
</div>
.md-custom-listview .mbsc-lv-item {
background: #c3e8fb;
padding-top: 30px;
padding-bottom: 30px;
}
.md-custom-listview .md-star-icon {
float: right;
font-weight: bold;
color: #ff8400;
}
.md-custom-listview .md-star-icon:before {
margin-right: 5px;
}
Listview - Image/Icon/Avatar
mobiscroll.settings = {
lang: '',
theme: '',
themeVariant: ''
};
$('#image').mobiscroll().listview({
enhance: true,
swipe: false
});
$('#icon').mobiscroll().listview({
enhance: true,
swipe: false
});
$('#avatar').mobiscroll().listview({
enhance: true,
swipe: false
});
<div mbsc-form>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Image</div>
<ul id="image" class="mbsc-cloak">
<li>
<img src="https://img.mobiscroll.com/demos/Requiem_for_a_Dream.png" />
<h3>Requiem for a Dream</h3>
<p>Directed by Darren Aronofsky</p>
</li>
<li>
<img src="https://img.mobiscroll.com/demos/The_Dark_Knight.png" />
<h3>The Dark Knight</h3>
<p>Directed by Christopher Nolan</p>
</li>
<li>
<img src="https://img.mobiscroll.com/demos/Despicable_Me.png" />
<h3>Despicable Me</h3>
<p>Directed by Pierre Coffin and Chris Renaud</p>
</li>
<li>
<img src="https://img.mobiscroll.com/demos/Mr_Nobody.png" />
<h3>Mr. Nobody</h3>
<p>Directed by Jaco Van Dormael</p>
</li>
</ul>
</div>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Icon</div>
<ul id="icon" class="mbsc-cloak">
<li data-icon="line-user">Edit profile</li>
<li data-icon="line-settings">Settings</li>
<li data-icon="line-heart">Rate</li>
<li data-icon="line-bubble">Tell a friend</li>
</ul>
</div>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Avatar</div>
<ul id="avatar" class="mbsc-cloak">
<li><img src="https://img.mobiscroll.com/demos/m1.png">
<h3>Barry Lyon</h3>
<p>(202) 555-0193</p>
</li>
<li><img src="https://img.mobiscroll.com/demos/f1.png">
<h3>Hortense Tinker</h3>
<p>(202) 555-0127</p>
</li>
<li><img src="https://img.mobiscroll.com/demos/m2.png">
<h3>Carl Hambledon</h3>
<p>(202) 555-0147</p>
</li>
<li><img src="https://img.mobiscroll.com/demos/f2.png">
<h3>Arlene Sharman</h3>
<p>(202) 555-0190</p>
</li>
</ul>
</div>
</div>
Listview - Selecting items
$(function () {
$('#single').mobiscroll().listview({
theme: '',
themeVariant: '',
lang: '',
select: 'single'
});
$('#multiple').mobiscroll().listview({
theme: '',
themeVariant: '',
lang: '',
select: 'multiple'
});
});
<div mbsc-form>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Singe item select</div>
<ul id="single" class="mbsc-cloak">
<li>The Shawshank Redemption (1994)</li>
<li>The Godfather (1972)</li>
<li data-selected="true">The Godfather: Part II (1974)</li>
<li>The Dark Knight (2008)</li>
<li>12 Angry Men (1957)</li>
<li>Schindler's List (1993)</li>
<li>The Lord of the Rings: The Return of the King (2003)</li>
<li>Pulp Fiction (1994)</li>
</ul>
</div>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Multiple item select</div>
<ul id="multiple" class="mbsc-cloak">
<li>The Good, the Bad and the Ugly (1966)</li>
<li>Fight Club (1999)</li>
<li data-selected="true">The Lord of the Rings: The Fellowship of the Ring (2001)</li>
<li>Forrest Gump (1994)</li>
<li data-selected="true">Star Wars: Episode V - The Empire Strikes Back (1980)</li>
<li data-selected="true">Inception (2010)</li>
<li>The Lord of the Rings: The Two Towers (2002)</li>
<li>One Flew Over the Cuckoo's Nest (1975)</li>
</ul>
</div>
</div>
Listview - Sorting & ordering
mobiscroll.settings = {
lang: '',
theme: '',
themeVariant: ''
};
$(function () {
$('#demo').mobiscroll().listview({
swipe: false,
sortable: {
handle: 'right'
},
enhance: true
});
$('#left').mobiscroll().listview({
swipe: false,
sortable: {
handle: 'left'
},
enhance: true
});
$('#no-handle').mobiscroll().listview({
swipe: false,
sortable: true,
enhance: true
});
});
<div mbsc-form>
<div class="mbsc-note mbsc-note-primary mbsc-align-center">
Reorder items from the drag handle or grab and hold to sort.
</div>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Handle on the right</div>
<ul id="demo" class="mbsc-cloak">
<li><img src="https://img.mobiscroll.com/demos/m1.png" />
<h3>Barry Lyon</h3>
<p>(202) 555-0193</p>
</li>
<li><img src="https://img.mobiscroll.com/demos/f1.png" />
<h3>Hortense Tinker</h3>
<p>(202) 555-0127</p>
</li>
<li><img src="https://img.mobiscroll.com/demos/m2.png" />
<h3>Carl Hambledon</h3>
<p>(202) 555-0147</p>
</li>
<li><img src="https://img.mobiscroll.com/demos/f2.png" />
<h3>Arlene Sharman</h3>
<p>(202) 555-0190</p>
</li>
</ul>
</div>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Handle on the left</div>
<ul id="left" class="mbsc-cloak">
<li><img src="https://img.mobiscroll.com/demos/m1.png" />
<h3 style="">Barry Lyon</h3>
<p>(202) 555-0193</p>
</li>
<li><img src="https://img.mobiscroll.com/demos/f1.png" />
<h3>Hortense Tinker</h3>
<p>(202) 555-0127</p>
</li>
<li><img src="https://img.mobiscroll.com/demos/m2.png" />
<h3>Carl Hambledon</h3>
<p>(202) 555-0147</p>
</li>
<li><img src="https://img.mobiscroll.com/demos/f2.png" />
<h3>Arlene Sharman</h3>
<p>(202) 555-0190</p>
</li>
</ul>
</div>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Tap and hold to start reordering</div>
<ul id="no-handle" class="mbsc-cloak">
<li><img src="https://img.mobiscroll.com/demos/m1.png" />
<h3>Barry Lyon</h3>
<p>(202) 555-0193</p>
</li>
<li><img src="https://img.mobiscroll.com/demos/f1.png" />
<h3>Hortense Tinker</h3>
<p>(202) 555-0127</p>
</li>
<li><img src="https://img.mobiscroll.com/demos/m2.png" />
<h3>Carl Hambledon</h3>
<p>(202) 555-0147</p>
</li>
<li><img src="https://img.mobiscroll.com/demos/f2.png" />
<h3>Arlene Sharman</h3>
<p>(202) 555-0190</p>
</li>
</ul>
</div>
</div>
Listview - Sticky header
$(function () {
$('#demo').mobiscroll().listview({
theme: '',
themeVariant: '',
lang: '',
fixedHeader: true,
swipe: false
});
});
<ul id="demo" class="mbsc-cloak">
<li data-role="list-divider">A</li>
<li>Audie Pennington</li>
<li>Audrea Delaughter</li>
<li>Augustine Brink</li>
<li>Aurelio Deveau</li>
<li>Aurora Marston</li>
<li data-role="list-divider">B</li>
<li>Bobby Weisman</li>
<li>Bobbye Clapp</li>
<li>Bobette Boyland</li>
<li>Boris Latta</li>
<li>Boyce Haller</li>
<!-- Showing partial data. Download full source. -->
</ul>
Listview - Grouping
$(function () {
$('#demo').mobiscroll().listview({
theme: '',
themeVariant: '',
lang: '',
swipe: false,
enhance: true
});
});
<div class="md-groupsort">
<ul id="demo" class="mbsc-cloak">
<li data-role="list-divider">Non alcoholic drinks</li>
<li><img src="https://img.mobiscroll.com/demos/dCappuccino.jpg" class="md-img" /> Cappuccino <span class="md-price">$3.00</span></li>
<li><img src="https://img.mobiscroll.com/demos/dCoffee.jpg" class="md-img" /> Coffee <span class="md-price">$2.60</span></li>
<li><img src="https://img.mobiscroll.com/demos/dCola.jpg" class="md-img" />Coca Cola <span class="md-price">$3.50</span></li>
<li><img src="https://img.mobiscroll.com/demos/dMilk.jpg" class="md-img" />Milk <span class="md-price">$2.50</span></li>
<li><img src="https://img.mobiscroll.com/demos/dPepsi.jpg" class="md-img" />Pepsi <span class="md-price">$3.50</span></li>
<li><img src="https://img.mobiscroll.com/demos/dTea.jpg" class="md-img" />Tea <span class="md-price">$3.00</span></li>
<li><img src="https://img.mobiscroll.com/demos/dWater.jpg" class="md-img" />Water <span class="md-price">$2.00</span></li>
<li data-role="list-divider">Alcoholic drinks</li>
<li><img src="https://img.mobiscroll.com/demos/dBeer.jpg" class="md-img" />Beer <span class="md-price">$3.00</span></li>
<li><img src="https://img.mobiscroll.com/demos/dGin.jpg" class="md-img" />Gin <span class="md-price">$4.00</span></li>
<li><img src="https://img.mobiscroll.com/demos/dMartini.jpg" class="md-img" />Martini <span class="md-price">$4.50</span></li>
<li><img src="https://img.mobiscroll.com/demos/dRum.jpg" class="md-img" />Rum <span class="md-price">$5.00</span></li>
<li><img src="https://img.mobiscroll.com/demos/dWine.jpg" class="md-img" />Wine <span class="md-price">$4.50</span></li>
<li><img src="https://img.mobiscroll.com/demos/dWhiskey.jpg" class="md-img" />Whiskey <span class="md-price">$6.00</span></li>
</ul>
</div>
.md-groupsort .mbsc-lv .mbsc-lv-item .md-img {
border-radius: 40px;
}
.md-price {
float: right;
}
Listview - Create, Read, Update, Delete
$(function () {
var lv,
formatDate = mobiscroll.util.datetime.formatDate;
lv = $('#demo').mobiscroll().listview({
theme: '',
themeVariant: '',
lang: '',
stages: [{
percent: -25,
color: 'red',
text: 'Delete',
confirm: true,
action: function (event, inst) {
inst.remove(event.target);
return false;
}
}, {
percent: 25,
color: 'green',
text: 'Update',
action: function (event, inst) {
$(event.target).find('.md-timestamp').text(formatDate('DD d hh:ii:ss A', new Date()));
}
}]
}).mobiscroll('getInst');
$('.md-timestamp').each(function () {
$(this).text(formatDate('DD d hh:ii:ss A', new Date()));
});
$('#add').on('click', function () {
mobiscroll.prompt({
title: 'New item',
message: 'Enter a description and add it to the list of existing tasks.',
placeholder: 'What to do next...',
callback: function (value) {
if (value !== null) {
lv.add(null, mobiscroll.$('<li>' + (value ? value : 'New item') + '<div class="md-timestamp mbsc-italic">' + formatDate('DD d hh:ii:ss A', new Date()) + '</div></li>'));
mobiscroll.toast({
message: 'New item added'
});
}
}
});
});
});
<div mbsc-form>
<div class="mbsc-note mbsc-note-primary mbsc-align-center">
Slide left to delete, right to update item timestamp. Add new items from prompt.
</div>
<ul id="demo" class="mbsc-cloak">
<li data-id="1">Check Mobiscroll demos
<div class="md-timestamp mbsc-italic"></div>
</li>
<li data-id="2">Feed the pets
<div class="md-timestamp mbsc-italic"></div>
</li>
<li data-id="3">Send an invitation email to Emily
<div class="md-timestamp mbsc-italic"></div>
</li>
<li data-id="4">Watch the new Arrow episode
<div class="md-timestamp mbsc-italic"></div>
</li>
<li data-id="5">Wash the dishes
<div class="md-timestamp mbsc-italic"></div>
</li>
</ul>
<div class="mbsc-btn-group-block">
<button mbsc-button id="add">Add new item</button>
</div>
</div>
Listview - Remove/Undo
$(function () {
$('#demo-remove-undo').mobiscroll().listview({
theme: '',
themeVariant: '',
lang: '',
stages: [{
percent: -30,
action: remove,
undo: true
}, {
percent: 30,
action: remove,
undo: true
}]
});
function remove(ev, inst) {
inst.remove(ev.target);
return false;
}
});
<div class="mbsc-note mbsc-note-primary mbsc-align-center">
Swipe left or right to remove items.
</div>
<ul id="demo-remove-undo" class="md-mailbox mbsc-cloak">
<li>
<div class="md-mail-icon" style="background:#4c66a4;">F</div>
<div class="md-mail-date">Nov 4</div>
<div class="md-mail-from">Facebook</div>
<div class="md-mail-subject">Your weekly page update</div>
</li>
<li>
<div class="md-mail-icon" style="background:#287BBC;">L</div>
<div class="md-mail-date">Nov 1</div>
<div class="md-mail-from">LinkedIn</div>
<div class="md-mail-subject">Michael has endorsed you!</div>
</li>
<li>
<div class="md-mail-icon" style="background:#5185a8;">M</div>
<div class="md-mail-date">Oct 31</div>
<div class="md-mail-from">Mobiscroll</div>
<div class="md-mail-subject">October update</div>
</li>
<li>
<div class="md-mail-icon" style="background:#1a3665;">P</div>
<div class="md-mail-date">Oct 31</div>
<div class="md-mail-from">PayPal</div>
<div class="md-mail-subject"> Stay fashionable in the cold with PayPal</div>
</li>
<li>
<div class="md-mail-icon" style="background:#dd4b39;">G</div>
<div class="md-mail-date">Oct 28</div>
<div class="md-mail-from">Google+</div>
<div class="md-mail-subject">John Doe added you back on Google+</div>
</li>
<li>
<div class="md-mail-icon" style="background:#5185a8;">M</div>
<div class="md-mail-date">Oct 27</div>
<div class="md-mail-from">Mobiscroll</div>
<div class="md-mail-subject">Password reset information</div>
</li>
</ul>
.md-mailbox .mbsc-lv-item {
line-height: 20px;
padding: 10px 10px 10px 60px;
}
.md-mail-icon {
width: 40px;
line-height: 40px;
position: absolute;
top: 10px;
left: 10px;
color: #fff;
text-align: center;
text-shadow: none;
}
.md-mail-date {
position: absolute;
top: 10px;
right: 10px;
font-size: 12px;
}
.md-mail-from {
font-size: 14px;
}
.md-mail-subject {
font-size: 12px;
}
.md-mail-empty {
padding: 10px;
}
Listview - Swipe actions
mobiscroll.settings = {
lang: '',
theme: '',
themeVariant: ''
};
$(function () {
$('#action-list').mobiscroll().listview({
enhance: true,
stages: [{
percent: 25,
icon: 'link',
text: 'Get link',
action: function (event, inst) {
mobiscroll.toast({
message: 'Link copied'
});
}
}, {
percent: 50,
icon: 'download',
text: 'Download',
action: function (event, inst) {
mobiscroll.toast({
message: 'Downloaded'
});
}
}, {
percent: -25,
icon: 'print',
text: 'Print',
action: function (event, inst) {
mobiscroll.toast({
message: 'Printing...'
});
}
},
{
percent: -50,
icon: 'remove',
text: 'Delete',
confirm: true,
action: function (event, inst) {
inst.remove(event.target);
return false;
}
}
]
});
$('#action-menu').mobiscroll().listview({
enhance: true,
actions: [{
icon: 'link',
action: function (event, inst) {
mobiscroll.toast({
message: 'Linked'
});
}
}, {
icon: 'star3',
action: function (event, inst) {
mobiscroll.toast({
message: 'Starred'
});
}
}, {
icon: 'download',
action: function (event, inst) {
mobiscroll.toast({
message: 'Downloaded'
});
}
}, {
icon: 'print',
action: function (event, inst) {
mobiscroll.toast({
message: 'Printing...'
});
}
}, {
icon: 'remove',
undo: true,
action: function (event, inst) {
inst.remove(event.target);
return false;
}
}]
});
});
<div mbsc-form>
<div class="mbsc-align-center">
<div class="mbsc-note mbsc-note-primary">Reveal underlying actions when swiping items left and right.</div>
</div>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Action list</div>
<ul id="action-list" class="mbsc-cloak">
<li data-icon="image2">Image 1</li>
<li data-icon="image2">Image 2</li>
<li data-icon="image2">Image 3</li>
<li data-icon="image2">Image 4</li>
<li data-icon="image2">Image 5</li>
</ul>
</div>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Action menu</div>
<ul id="action-menu" class="mbsc-cloak">
<li data-icon="image2">My Image 1</li>
<li data-icon="image2">My Image 2</li>
<li data-icon="image2">My Image 3</li>
<li data-icon="image2">My Image 4</li>
<li data-icon="image2">My Image 5</li>
</ul>
</div>
</div>
Listview - Hierarchy
mobiscroll.settings = {
lang: '',
theme: '',
themeVariant: ''
};
$(function () {
$('#demo-hierarchy').mobiscroll().listview({
swipe: false,
enhance: true
});
$('#hierarchy-inside-card').mobiscroll().listview({
swipe: false,
enhance: true
});
});
<div mbsc-form>
<div class="mbsc-note mbsc-note-primary mbsc-align-center">
Build hierarchical listviews. Use it for navigation, inline or in modals.
</div>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Hierarchical listview</div>
<ul id="demo-hierarchy" class="mbsc-cloak">
<li>
<span class="md-continent micons icon-north-america"> </span> North America
<ul>
<li>
<img src="https://img.mobiscroll.com/demos/flags/us.png" /> USA
<ul>
<li>Washington</li>
<li>Florida</li>
<li>Los Angeles</li>
<li>New York</li>
<li>Detroit</li>
<li>Chicago</li>
</ul>
</li>
<li>
<img src="https://img.mobiscroll.com/demos/flags/ca.png" /> Canada
<ul>
<li>Vancouver</li>
<li>Winnipeg</li>
<li>Calgary</li>
<li>Montreal</li>
<li>Quebec</li>
</ul>
</li>
</ul>
</li>
<li>
<span class="md-continent micons icon-south-america"></span> South America
<ul>
<li>
<img src="https://img.mobiscroll.com/demos/flags/ar.png" /> Argentina
<ul>
<li>Buenos Aires</li>
<li>Córdoba</li>
<li>Rosario</li>
<li>Mendoza</li>
</ul>
</li>
<li>
<img src="https://img.mobiscroll.com/demos/flags/br.png" /> Brazil
<ul>
<li>Rio de Janeiro</li>
<li>Sao Paolo</li>
<li>Brasília</li>
<li>Salvador</li>
<li>Fortaleza</li>
</ul>
</li>
<li>
<img src="https://img.mobiscroll.com/demos/flags/cl.png" /> Chile
<ul>
<li>Santiago</li>
<li>Concepción</li>
<li>Valparaíso</li>
</ul>
</li>
</ul>
</li>
<!-- Showing partial data. Download full source. -->
</ul>
</div>
<div class="mbsc-padding">The listview can also be rendered inside a card</div>
<div mbsc-card>
<ul id="hierarchy-inside-card" class="mbsc-cloak">
<li>
<span class="md-continent micons icon-north-america"> </span> North America
<ul>
<li>
<img src="https://img.mobiscroll.com/demos/flags/us.png" /> USA
<ul>
<li>Washington</li>
<li>Florida</li>
<li>Los Angeles</li>
<li>New York</li>
<li>Detroit</li>
<li>Chicago</li>
</ul>
</li>
<li>
<img src="https://img.mobiscroll.com/demos/flags/ca.png" /> Canada
<ul>
<li>Vancouver</li>
<li>Winnipeg</li>
<li>Calgary</li>
<li>Montreal</li>
<li>Quebec</li>
</ul>
</li>
</ul>
</li>
<li>
<span class="md-continent micons icon-south-america"></span> South America
<ul>
<li>
<img src="https://img.mobiscroll.com/demos/flags/ar.png" /> Argentina
<ul>
<li>Buenos Aires</li>
<li>Córdoba</li>
<li>Rosario</li>
<li>Mendoza</li>
</ul>
</li>
<li>
<img src="https://img.mobiscroll.com/demos/flags/br.png" /> Brazil
<ul>
<li>Rio de Janeiro</li>
<li>Sao Paolo</li>
<li>Brasília</li>
<li>Salvador</li>
<li>Fortaleza</li>
</ul>
</li>
<li>
<img src="https://img.mobiscroll.com/demos/flags/cl.png" /> Chile
<ul>
<li>Santiago</li>
<li>Concepción</li>
<li>Valparaíso</li>
</ul>
</li>
</ul>
</li>
<!-- Showing partial data. Download full source. -->
</ul>
</div>
</div>
.md-country .mbsc-lv-img {
margin-top: -.6em;
width: 2em;
}
.md-continent {
font-size: 36px;
position: absolute;
height: 1em;
width: 1em;
top: 50%;
margin-top: -.5em;
left: .42em;
text-align: center;
}
Listview - Checklist
$(function () {
var id = 6;
$('#demo').mobiscroll().listview({
theme: '',
themeVariant: '',
lang: '',
sortable: {
handle: 'left'
},
stages: {
left: [{
key: 'stage1',
icon: 'plus',
color: '#31c6e7',
text: 'Add',
action: function (event, inst) {
inst.add(null, '<input mbsc-checkbox type="checkbox" /> New Todo', event.index + 1);
}
}],
right: [{
key: 'stage2',
color: '#009688',
text: 'Remove',
icon: 'remove',
action: function (event, inst) {
inst.remove(event.target);
return false;
}
}]
}
});
});
<div mbsc-form>
<div class="mbsc-note mbsc-note-primary mbsc-align-center">
Check items off, swipe left/right to remove & add, reorder from the handle.
</div>
<div class="mbsc-form-group">
<ul id="demo" class="mbsc-cloak" mbsc-enhance>
<li><input mbsc-checkbox type="checkbox" checked />Do the laundry</li>
<li><input mbsc-checkbox type="checkbox" />Check out new Mobiscroll features</li>
<li><input mbsc-checkbox type="checkbox" checked />Don't forget mom's birthday!</li>
<li><input mbsc-checkbox type="checkbox" />Update my app with the latest Mobiscroll</li>
<li><input mbsc-checkbox type="checkbox" />Buy new shoes</li>
<li><input mbsc-checkbox type="checkbox" />Need ketchup for pizza</li>
</ul>
</div>
</div>
Listview - Filtering
// Use the settings object to change the theme
mobiscroll.settings = {
lang: '',
theme: '',
themeVariant: ''
};
$(function () {
var formatDate = mobiscroll.util.datetime.formatDate;
var demoApp = {
data: [],
nothingScheduled: $('.md-no-schedule'),
filters: {
range: 'today',
calls: true,
meetings: true
},
loadData: function () {
var i,
now = new Date(),
data = [{
id: 1,
name: "Owen Adams",
company: "Sunholdings Corp.",
icon: "phone",
type: "call"
}, {
id: 2,
name: "Kian Phillips",
company: "sol-flex Corp.",
icon: "location",
type: "meeting"
}, {
id: 3,
name: "Robert Bradley",
company: "Silvermedia",
icon: "location",
type: "meeting"
}, {
id: 4,
name: "Lydia Young",
company: "Zimplex",
icon: "phone",
type: "call"
}, {
id: 5,
name: "Hollie Hudson",
company: "Stanelectrics",
icon: "location",
type: "meeting"
}, {
id: 6,
name: "Lynn Elliott",
company: "Techhex",
icon: "location",
type: "meeting"
}, {
id: 7,
name: "Konner Murray",
company: "HACME Corp.",
icon: "phone",
type: "call"
}, {
id: 8,
name: "Morgan Downs",
company: "Itex Corp.",
icon: "location",
type: "meeting"
}, {
id: 9,
name: "Warren Boone",
company: "Sumline",
icon: "location",
type: "meeting"
}, {
id: 10,
name: "Charlie Jenkins",
company: "Quaddoex",
icon: "phone",
type: "call"
}, {
id: 11,
name: "Jillian Hobbs",
company: "Indizap",
icon: "location",
type: "meeting",
formatedTime: ''
}, {
id: 12,
name: "Donald Mccormick",
company: "Zootrax",
icon: "phone",
type: "call"
}, {
id: 13,
name: "Luke Harper",
company: "Unihouse",
icon: "phone",
type: "call"
}, {
id: 14,
name: "Leah West",
company: "Ap-care",
icon: "phone",
type: "call"
}, {
id: 15,
name: "Billie Rivas",
company: "Technoit Corp.",
icon: "location",
type: "meeting"
}, {
id: 16,
name: "Janae Diaz",
company: "Plex-ron Corp.",
icon: "location",
type: "meeting"
}, {
id: 17,
name: "Raquel Bentley",
company: "Silicon-lax",
icon: "phone",
type: "call"
}, {
id: 18,
name: "Harley Burke",
company: "Lamzone",
icon: "location",
type: "meeting"
}];
// Genarate random dates
for (i = 0; i < data.length; ++i) {
data[i].date = new Date(
now.getFullYear(),
now.getMonth(),
now.getDate() + (i > 5 ? (i - 5) : 0),
now.getHours() + i * 2,
Math.round((now.getMinutes() + i * 5) / 5) * 5);
}
this.data = data;
},
filter: function () {
var i,
item,
start,
end,
range,
now = new Date(),
count = 0;
switch (this.filters.range) {
case 'today':
start = new Date(now.setHours(0, 0, 0, 0));
end = new Date(now.setHours(23, 59, 59, 999));
break;
case 'week':
start = new Date(now.setHours(0, 0, 0, 0));
end = new Date(
now.getFullYear(),
now.getMonth(),
now.getDate() + (7 - now.getDay()), 23, 59, 59, 999
);
break;
default:
range = this.range.getVal();
start = range[0];
end = range[1];
}
for (i = 0; i < this.data.length; i++) {
item = this.data[i];
if ((
(item.type == 'call' && this.filters.calls) ||
(item.type == 'meeting' && this.filters.meetings)
) && (item.date >= start) && (item.date <= end)) {
if (!item._added) {
// Add to listview
this.listview.add(item.id, mobiscroll.$(
'<li data-id="' + item.id + '" data-icon="' + item.icon + '">' +
'<h4>' + item.name + '</h4>' +
'<h4>' + item.company + '</h4>' +
'<span class="md-time" style="position:absolute;right:1.25em;top:50%;margin-top:-9px;">' + formatDate('D d hh:ii', item.date) +
'</span>' +
'</li>'));
item._added = true;
}
count++;
} else if (item._added) {
// Remove from listview
this.listview.remove(item.id);
item._added = false;
}
}
if (count === 0) {
this.nothingScheduled.show();
} else {
this.nothingScheduled.hide();
}
},
init: function () {
var now = new Date(),
that = this;
// Load data
this.loadData();
// Init range
this.range = $('.md-schedule-range').mobiscroll().range().mobiscroll('getInst');
// Init listview
this.listview = $('.md-schedule-list').mobiscroll().listview({
enhance: true,
swipe: false,
striped: true,
onInit: function (ev, inst) {
setTimeout(function () {
that.filter();
});
}
}).mobiscroll('getInst');
// Attach change listener to all filters
$('.md-schedule-filter').change(function (ev) {
var input = ev.target;
if (input.type == 'checkbox') {
that.filters[input.name] = input.checked;
} else if (input.type == 'radio') {
that.filters[input.name] = input.value;
} else if (input.name == 'custom') {
that.filters.range = 'custom';
}
that.filter();
});
this.nothingScheduled.hide();
// Show rangepicker when selecting custom range
$('.md-schedule-custom').click(function () {
that.range.show();
});
}
};
demoApp.init();
})
<div class="md-schedule" mbsc-form>
<div class="mbsc-note mbsc-note-primary mbsc-align-center">
Dynamically filter listview content. Add/remove items or call a full reload.
</div>
<div class="mbsc-form-group">
<label>
Today
<input mbsc-segmented type="radio" class="md-schedule-filter" value="today" name="range" checked>
</label>
<label>
this Week
<input mbsc-segmented type="radio" class="md-schedule-filter" value="week" name="range">
</label>
<label>
Custom
<input mbsc-segmented type="radio" class="md-schedule-filter md-schedule-custom" value="custom" name="range">
</label>
<div class="md-schedule-range md-schedule-filter"></div>
<label>
Show Calls
<input mbsc-switch class="md-schedule-filter" type="checkbox" name="calls" checked>
</label>
<label>
Show Meetings
<input mbsc-switch class="md-schedule-filter" type="checkbox" name="meetings" checked>
</label>
</div>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">My Schedule</div>
<div class="mbsc-empty md-no-schedule mbsc-cloak">
<h3>Nothing scheduled</h3>
</div>
<ul class="md-schedule-list"></ul>
</div>
</div>
Listview - Data sources
mobiscroll.settings = {
lang: '',
theme: '',
themeVariant: ''
};
$(function () {
var i, li,
ul = $('#demo-data-sources-gen'),
movies = [
'Django Unchained (2012)',
'WALL·E (2008)',
'Princess Mononoke (1997)',
'American Beauty (1999)',
'The Dark Knight Rises (2012)'
];
for (i = 0; i < movies.length; i++) {
ul.append('<li>' + movies[i] + '</li>');
}
$('#demo-data-sources').mobiscroll().listview();
ul.mobiscroll().listview();
$('#demo-data-sources-remote').mobiscroll().listview({
onInit: function (event, inst) {
var item;
mobiscroll.util.getJson('https://trial.mobiscroll.com/getmovies/?nr=5', function (data) {
for (i = 0; i < data.length; ++i) {
item = data[i];
inst.add(item.id, item.title);
}
}, 'jsonp');
}
});
});
<div mbsc-form>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Hardcoded items</div>
<ul id="demo-data-sources" class="mbsc-cloak">
<li>Casablanca (1942)</li>
<li>The Intouchables (2011)</li>
<li>Modern Times (1936)</li>
<li>The Pianist (2002)</li>
<li>The Departed (2006)</li>
</ul>
</div>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Generated markup</div>
<ul id="demo-data-sources-gen" class="mbsc-cloak"></ul>
</div>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Remote data</div>
<ul id="demo-data-sources-remote" class="mbsc-cloak"></ul>
</div>
</div>
Listview - Load on demand
$(function () {
var list,
isLoading = false,
feedNum = 5;
function jsonp(url, callback) {
var callbackName = 'jsonp_callback_' + Math.round(100000 * Math.random());
window[callbackName] = function (data) {
delete window[callbackName];
document.body.removeChild(script);
callback(data);
};
var script = document.createElement('script');
script.src = url + (url.indexOf('?') >= 0 ? '&' : '?') + 'callback=' + callbackName;
document.body.appendChild(script);
}
function getFeed() {
var i, entry, img, content, text, li;
if (list) {
list.showLoading();
}
jsonp('https://api.rss2json.com/v1/api.json?rss_url=http%3A%2F%2Ffeeds.arstechnica.com%2Farstechnica%2Ftechnology-lab%2F&api_key=ytdlqir4cx7dpdb9asyawz4lteioxq5uwl5ctd9n&count=' + feedNum, function (result) {
if (result.status == 'ok') {
for (i = feedNum - 5; i < result.items.length; i++) {
entry = result.items[i];
img = entry.thumbnail ? entry.content.match(/src="[^ ]*/)[0] : '';
content = /\<p\>(.*)(\.\s)/.exec(entry.content);
text = content ? content[1] : '';
li = '<div>';
li += '<h4>' + entry.title + '</h4>';
li += '<a href="' + entry.link + '" target="_blank"><img ' + img + ' /></a>';
li += '<p class="md-text">' + text + ' ... <a rel="nofollow" href="' + entry.link + '" target="_blank"> Read more →</a></p>';
li += '<div class="md-text md-author"> by <a rel="nofollow" href="' + entry.link + '" target="_blank">' + entry.author + '</a></div>';
li += '</div>';
list.add(null, li);
}
isLoading = false;
list.hideLoading();
}
});
}
list = $('#demo').mobiscroll().listview({
theme: '',
themeVariant: '',
lang: '',
striped: true,
animateAddRemove: false,
swipe: false,
onListEnd: function (event, inst) {
if (!isLoading) {
isLoading = true;
feedNum += 5;
getFeed();
}
},
onInit: function (event, inst) {
getFeed();
}
}).mobiscroll('getInst');
});
<ul id="demo" class="md-news mbsc-cloak" mbsc-enhance>
<li data-role="list-divider">Arstechnica News</li>
</ul>
.md-news .mbsc-lv-item img {
width: 100%;
}
.md-news .mbsc-lv-item h4 {
margin-top: 0;
font-weight: 100;
}
.md-news .mbsc-lv-item .md-author {
margin-top: 0;
text-align: right;
font-size: 14px;
font-style: italic;
}
Listview - Load more
// Use the settings object to change the theme
mobiscroll.settings = {
theme: '',
themeVariant: ''
};
$(function () {
var list,
$btnMore = $('#more'),
length = 10;
function getMovies() {
$btnMore.hide();
list.showLoading();
mobiscroll.util.getJson('https://trial.mobiscroll.com/loadmore/?length=' + length, function (data) {
var i, item;
for (i = 0; i < data.length; ++i) {
item = data[i];
list.add(item.id, item.title);
}
$btnMore.show();
list.hideLoading();
if (length >= 100) {
$btnMore.hide();
}
}, 'jsonp');
}
list = $('#demo').mobiscroll().listview({
theme: '',
themeVariant: '',
lang: '',
animateAddRemove: false,
striped: true,
swipe: false,
}).mobiscroll('getInst');
$btnMore.click(function (ev) {
length += 10;
getMovies();
});
getMovies();
});
<ul id="demo" class="mbsc-cloak" mbsc-enhance>
<li data-role="list-divider">Top Rated Movies</li>
</ul>
<div class="mbsc-padding" mbsc-form>
<button mbsc-button id="more" class="mbsc-btn-block">Load more</button>
</div>
Listview - Master-detail view
Build a two pane master-detail view with the help of the listview. Use the grid layout to set up the two columns - left side for a list of names, right side for showing the details. If you want to get into the details you could even hide the first column and build a drawer or use a hamburger menu for the master list.
Use the navigation component for the tabs and cards for building the layout of the details view.
mobiscroll.settings = {
lang: '',
theme: '',
themeVariant: ''
};
$(function () {
function createProfiles(data) {
for (var i = 0; i < data.length; ++i) {
var elm = $('.master-tab-profile')[i],
pers = data[i];
$(elm).html(
'<div mbsc-card><div class="mbsc-card-content"><div class="mbsc-row">' +
'<div class="mbsc-col-md-6 mbsc-col-12">' +
'<label>First name <input mbsc-input value="' + pers.first + '" data-input-style="box" data-label-style="floating" /></label>' +
'</div><div class="mbsc-col-md-6 mbsc-col-12">' +
'<label>Last name<input mbsc-input value="' + pers.last + '" data-input-style="box" data-label-style="floating" /></label>' +
'</div></div><div class="mbsc-row"><div class="mbsc-col-md-6 mbsc-col-12">' +
'<label>Email<input mbsc-input value="' + pers.email + '" data-input-style="box" data-label-style="floating" /></label>' +
'</div></div><div class="mbsc-row"><div class="mbsc-col-md-6 mbsc-col-12">' +
'<label>Company<input mbsc-input value="' + pers.company + '" data-input-style="box" data-label-style="floating" /></label>' +
'</div><div class="mbsc-col-md-6 mbsc-col-12">' +
'<label>Role<select mbsc-dropdown data-input-style="box" data-label-style="floating">' +
'<option value="ceo"' + (pers.role == 'ceo' ? 'selected' : '') + '>CEO</option>' +
'<option value="cto"' + (pers.role == 'cto' ? 'selected' : '') + '>CTO</option>' +
'<option value="vpp"' + (pers.role == 'vpp' ? 'selected' : '') + '>VP of Product</option>' +
'<option value="vpm"' + (pers.role == 'vpm' ? 'selected' : '') + '>VP of Marketing</option>' +
'<option value="vpe"' + (pers.role == 'vpe' ? 'selected' : '') + '>VP of Engineering</option>' + '</select></label>' +
'</div></div><div class="mbsc-row mbsc-align-items-end"><div class="mbsc-col-md-6 mbsc-col-12">' +
'<label>Notes<textarea mbsc-textarea data-input-style="box" data-label-style="floating">' + pers.notes + '</textarea></label>' +
'</div></div><div class="mbsc-row mbsc-justify-content-end"><div class="mbsc-col-md-6 mbsc-col-12"><div class="mbsc-pull-right mbsc-btn-group">' +
'<button mbsc-button class="mbsc-btn-primary">Update</button>' +
'<button mbsc-button class="mbsc-btn-secondary">Email</button>' +
'<button mbsc-button class="mbsc-btn-secondary">Call</button>' +
'<button mbsc-button class="mbsc-btn-secondary">Meet</button>' +
'</div></div></div></div></div>');
$(elm).trigger('mbsc-enhance');
}
}
function createConversations(data) {
for (var i = 0; i < data.length; ++i) {
var elm = $('.master-tab-conv')[i],
convs = data[i].conv,
conv = '';
for (var j = 0; j < convs.length; ++j) {
var c = convs[j];
conv = conv + '<div mbsc-card data-collapsible data-open><div class="mbsc-card-header"><span class="mbsc-bold">' + c.title +
'</span><span class="mbsc-pull-right mbsc-card-subtitle">' + mobiscroll.util.datetime.formatDate('D, d h:ii A', new Date(c.date)) +
'</span></div><div class="mbsc-card-content">' + c.text + '</div></div>';
}
$(elm).html(conv).trigger('mbsc-enhance');
}
}
function createTasks(data) {
for (var i = 0; i < data.length; ++i) {
var elm = $('.master-tab-tasks')[i],
task = data[i].tasks;
$(elm).html(
'<div mbsc-card><div class="mbsc-card-header"><h2 class="mbsc-card-title">' +
'Qualification process with lead</h2></div><div class="mbsc-card-content mbsc-no-padding">' +
'<label>Understanding business problem we can fix.<input mbsc-checkbox type="checkbox"' + (task[0] ? 'checked' : '') + '></label>' +
'<label>How are they solving the problem at the moment?<input mbsc-checkbox type="checkbox"' + (task[1] ? 'checked' : '') + '></label>' +
'<label>Do you have a budget allocated to solve this problem?<input mbsc-checkbox type="checkbox"' + (task[2] ? 'checked' : '') + '></label>' +
'<label>Understanding the budget signoff process.<input mbsc-checkbox type="checkbox"' + (task[3] ? 'checked' : '') + '></label>' +
'<label>What other solutions are you evaluating?<input mbsc-checkbox type="checkbox"' + (task[4] ? 'checked' : '') + '></label>' +
'<label>What does success look like?<input mbsc-checkbox type="checkbox"' + (task[5] ? 'checked' : '') + '></label>' +
'<label>What does solving the problem mean to you personally?<input mbsc-checkbox type="checkbox"' + (task[6] ? 'checked' : '') + '></label>' +
'<label>What\'s the deadline?<input mbsc-checkbox type="checkbox"' + (task[7] ? 'checked' : '') + '></label></div></div>');
$(elm).trigger('mbsc-enhance');
}
}
function randomCheck(data) {
return Math.random() >= .5 ? 'checked' : '';
}
$('#master-detail-list').mobiscroll().listview({
select: 'single',
onItemTap: function (event, inst) {
$('.md-master-item-sel').removeClass('md-master-item-sel');
$('#master-item-' + $(event.target).attr('data-item')).addClass('md-master-item-sel');
mobiscroll.settings = {
lang: '',
theme: '',
themeVariant: ''
};
// resize textarea
$('.md-master-item-sel textarea').trigger('mbsc-enhance');
}
});
$('#master-detail-tab').mobiscroll().nav({
type: 'tab',
display: 'inline',
onInit: function (event, inst) {
// ajax data
mobiscroll.util.getJson('https://trial.mobiscroll.com/master-detail/', function (data) {
createProfiles(data);
createConversations(data);
createTasks(data);
}, 'jsonp');
},
onItemTap: function (event, inst) {
$('.md-master-tab-sel').removeClass('md-master-tab-sel');
$('.master-tab-' + $(event.target).attr('data-tab')).addClass('md-master-tab-sel');
mobiscroll.settings = {
lang: '',
theme: '',
themeVariant: ''
};
// resize textarea
$('.md-master-tab-sel textarea').trigger('mbsc-enhance');
}
});
});
<div mbsc-form class="md-master-detail-demo" style="overflow: hidden;">
<div class="mbsc-grid mbsc-no-padding">
<div class="mbsc-row">
<div class="mbsc-col-12 mbsc-col-md-2 mbsc-col-sm-3">
<ul id="master-detail-list" class="mbsc-cloak">
<li data-item="a" data-selected="true">Ashlee Conner</li>
<li data-item="b">Bianca Baker</li>
<li data-item="c">Christopher Tran</li>
<li data-item="k">Konner Stone</li>
<li data-item="l">Leon Medina</li>
<li data-item="n">Nora Leonard</li>
<li data-item="o">Octavio Daniels</li>
<li data-item="r">Russell Wang</li>
<li data-item="t">Teresa Livingston</li>
<li data-item="z">Zoe Gilbert</li>
</ul>
</div>
<div class="mbsc-col-12 mbsc-col-md-10 mbsc-col-sm-9 md-col-border">
<ul id="master-detail-tab" class="mbsc-cloak">
<li data-tab="profile" data-selected="true">Profile</li>
<li data-tab="conv">Conversations</li>
<li data-tab="tasks">Tasks</li>
</ul>
<div id="master-item-a" class="md-master-item md-master-item-sel mbsc-form-grid">
<div class="master-tab-profile md-master-tab md-master-tab-sel"></div>
<div class="master-tab-conv md-master-tab"></div>
<div class="master-tab-tasks md-master-tab"></div>
</div>
<div id="master-item-b" class="md-master-item mbsc-form-grid">
<div class="master-tab-profile md-master-tab md-master-tab-sel"></div>
<div class="master-tab-conv md-master-tab"></div>
<div class="master-tab-tasks md-master-tab"></div>
</div>
<div id="master-item-c" class="md-master-item mbsc-form-grid">
<div class="master-tab-profile md-master-tab md-master-tab-sel"></div>
<div class="master-tab-conv md-master-tab"></div>
<div class="master-tab-tasks md-master-tab"></div>
</div>
<div id="master-item-k" class="md-master-item mbsc-form-grid">
<div class="master-tab-profile md-master-tab md-master-tab-sel"></div>
<div class="master-tab-conv md-master-tab"></div>
<div class="master-tab-tasks md-master-tab"></div>
</div>
<div id="master-item-l" class="md-master-item mbsc-form-grid">
<div class="master-tab-profile md-master-tab md-master-tab-sel"></div>
<div class="master-tab-conv md-master-tab"></div>
<div class="master-tab-tasks md-master-tab"></div>
</div>
<div id="master-item-n" class="md-master-item mbsc-form-grid">
<div class="master-tab-profile md-master-tab md-master-tab-sel"></div>
<div class="master-tab-conv md-master-tab"></div>
<div class="master-tab-tasks md-master-tab"></div>
</div>
<div id="master-item-o" class="md-master-item mbsc-form-grid">
<div class="master-tab-profile md-master-tab md-master-tab-sel"></div>
<div class="master-tab-conv md-master-tab"></div>
<div class="master-tab-tasks md-master-tab"></div>
</div>
<div id="master-item-r" class="md-master-item mbsc-form-grid">
<div class="master-tab-profile md-master-tab md-master-tab-sel"></div>
<div class="master-tab-conv md-master-tab"></div>
<div class="master-tab-tasks md-master-tab"></div>
</div>
<div id="master-item-t" class="md-master-item mbsc-form-grid">
<div class="master-tab-profile md-master-tab md-master-tab-sel"></div>
<div class="master-tab-conv md-master-tab"></div>
<div class="master-tab-tasks md-master-tab"></div>
</div>
<div id="master-item-z" class="md-master-item mbsc-form-grid">
<div class="master-tab-profile md-master-tab md-master-tab-sel"></div>
<div class="master-tab-conv md-master-tab"></div>
<div class="master-tab-tasks md-master-tab"></div>
</div>
</div>
</div>
</div>
</div>
.md-master-detail-demo,
.md-master-detail-demo .mbsc-row {
height: 100%;
}
.md-master-detail-demo .mbsc-grid {
height: 100%;
}
.md-master-detail-demo .md-col-border {
overflow: auto;
height: 100%;
min-height: 800px;
border-left: 1px solid #ccc;
}
.md-master-detail-demo .mbsc-ms-c {
border-top: 0;
}
.md-master-tab,
.md-master-item {
display: none;
}
.md-master-tab-sel,
.md-master-item-sel {
display: block;
}
Listview - Event handlers
EVENTS FIRED:
$(function () {
var ids = 15;
$('#demo').mobiscroll().listview({
theme: '',
themeVariant: '',
lang: '',
sortable: { handle: 'left' },
iconSlide: true,
striped: true,
stages: [{
percent: 25,
color: 'crimson',
icon: 'checkmark',
text: 'Complete',
action: function (event, inst) {
$('.md-wo-status', event.target).text('Completed');
}
}, {
percent: -50,
color: 'red',
icon: 'remove',
text: 'Delete',
confirm: true,
action: function (event, inst) {
inst.remove(event.target);
return false;
}
}, {
percent: 50,
color: 'green',
icon: 'plus',
text: 'Spawn',
action: function (event, inst) {
inst.add(++ids, 'Work order #000' + ids + ' created from WO #000' + $(event.target).attr('data-id') + '<div class="md-wo-status">Assigned</div>', event.index + 1);
}
}, {
percent: -25,
color: 'olive',
icon: 'clock',
text: 'Pending',
action: function (event, inst) {
$('.md-wo-status', event.target).text('Pending');
}
}],
onItemAdd: function () {
// Your custom event handler goes here
},
onItemRemove: function () {
// Your custom event handler goes here
},
onInit: function (event, inst) {
// Your custom event handler goes here
},
onItemTap: function (event, inst) {
// Your custom event handler goes here
},
onNavEnd: function (event, inst) {
// Your custom event handler goes here
},
onNavStart: function (event, inst) {
// Your custom event handler goes here
},
onSlideEnd: function (event, inst) {
// Your custom event handler goes here
},
onSlideStart: function (event, inst) {
// Your custom event handler goes here
},
onSort: function (event, inst) {
// Your custom event handler goes here
},
onSortChange: function (event, inst) {
// Your custom event handler goes here
},
onSortEnd: function (event, inst) {
// Your custom event handler goes here
},
onSortStart: function (event, inst) {
// Your custom event handler goes here
},
onSortUpdate: function (event, inst) {
// Your custom event handler goes here
},
onStageChange: function (event, inst) {
// Your custom event handler goes here
},
onListEnd: function (event, inst) {
// Your custom event handler goes here
}
});
});
<ul id="demo" class="mbsc-cloak">
<li data-id="1">Work order #0001
<div class="md-wo-status">Assigned</div>
</li>
<li data-id="2">Work order #0002
<div class="md-wo-status">Assigned</div>
</li>
<li data-id="3">Work order #0003
<div class="md-wo-status">Assigned</div>
</li>
<li data-id="4">Work order #0004
<div class="md-wo-status">Assigned</div>
</li>
<li data-id="5">Work order #0005
<div class="md-wo-status">Assigned</div>
</li>
<li data-id="6">Work order #0006
<div class="md-wo-status">Assigned</div>
</li>
<li data-id="6">Work order #0007
<div class="md-wo-status">Assigned</div>
</li>
<li data-id="6">Work order #0008
<div class="md-wo-status">Assigned</div>
</li>
<li data-id="6">Work order #0009
<div class="md-wo-status">Assigned</div>
</li>
<li data-id="6">Work order #00010
<div class="md-wo-status">Assigned</div>
</li>
<li data-id="6">Work order #00011
<div class="md-wo-status">Assigned</div>
</li>
<li data-id="6">Work order #00012
<div class="md-wo-status">Assigned</div>
</li>
<li data-id="6">Work order #00013
<div class="md-wo-status">Assigned</div>
</li>
<li data-id="6">Work order #00014
<div class="md-wo-status">Assigned</div>
</li>
<li data-id="6">Work order #00015
<div class="md-wo-status">Assigned</div>
</li>
</ul>
Listview - Quick Navigation
$(function () {
var timer,
firstletter,
currSelected = "A",
start = new Date(),
isScrolled = false,
$wndw = $(window),
$popup = $('.md-popup'),
isFavorite = false,
preventScroll = false,
$list = $('#demo'),
$listDeviders = $('#demo li[data-role=list-divider]'),
$optionList = $('.md-alfabet');
$list.mobiscroll().listview({
theme: '',
themeVariant: '',
lang: '',
swipe: false,
enhance: true,
onItemTap: function (event, inst) {
var target = $(event.domEvent.target);
if (target.hasClass('mbsc-ic')) {
$(event.target).toggleClass('star3');
target
.toggleClass('mbsc-ic-star3')
.toggleClass('mbsc-ic-star');
mobiscroll.toast({
message: 'Favorites updated'
});
}
}
});
$optionList.mobiscroll().optionlist({
theme: '',
themeVariant: '',
type: 'tabs',
display: 'top',
select: 'single',
onItemTap: function (event, inst) {
var item = $(event.target),
text = item.text();
preventScroll = true;
isFavorite = item.hasClass('md-item-star');
if (!isFavorite) {
$('.mbsc-lv-item:not(.star3)', $list).show();
$listDeviders.show();
$('.md-no-bookmark').hide();
} else {
$('.mbsc-lv-item:not(.star3)', $list).hide();
$listDeviders.hide();
if (!$('.star3').length) {
$('.md-no-bookmark').show();
}
}
if (!isScrolled && !isFavorite) {
$wndw.scrollTop($('.header' + text).next().position().top - $(this).height());
$popup.addClass('md-show-popup');
$popup.text(text);
clearTimeout(timer);
timer = setTimeout(function () {
$popup.removeClass('md-show-popup');
}, 1500);
}
}
});
$wndw.on('scroll trouchmove', function (ev) {
if (new Date() - start > 150 && !isFavorite) {
var currHeader,
wTop = $(this).scrollTop();
$listDeviders.each(function (i, v) {
if (wTop > $(v).position().top) {
currHeader = v;
return;
}
});
firstletter = currHeader.textContent;
isScrolled = true;
if (currSelected != firstletter) {
$optionList.mobiscroll('navigate', $('.md-item-' + firstletter), true);
}
currSelected = firstletter;
start = new Date();
isScrolled = false;
}
});
});
<div class="md-navigate">
<div class="md-popup">
c</div>
<ul class="md-alfabet">
<li class="md-item-star"><span class="mbsc-ic mbsc-ic-star3"></span</li>
<li class="md-item-A" data-selected="true">A</li>
<li class="md-item-B">B</li>
<li class="md-item-C">C</li>
<!-- Showing partial data. Download full source. -->
</ul>
<ul id="demo" class="md-list">
<li class="md-no-bookmark">
<div class="md-nob-title">Traveling to the same place frequently?</div>
<div class="md-nob-txt">You can bookmark airports by tapping on the star to the left and they will show up here.</div>
<div class="md-nob-separator"></div>
<img class="md-nob-img" src="https://img.mobiscroll.com/demos/lv-bookmark.png" >
</li>
<li data-role="list-divider" class="headerA">A</li>
<li data-icon="star">Abilene, TEXAS<span class="md-iata">(ABI)</span></li>
<li data-icon="star">Agana / Tamuning, GUAM<span class="md-iata">(GUM)</span></li>
<li data-icon="star">Aguadilla, PUERTO RICO<span class="md-iata">(BQN)</span></li>
<li data-icon="star">Akron / Canton, OHIO<span class="md-iata">(CAK)</span></li>
<li data-role="list-divider" class="headerB">B</li>
<li data-icon="star">Baltimore / Glen Burnie, MARYLAND<span class="md-iata">(BWI)</span></li>
<li data-icon="star">Bangor, MAINE<span class="md-iata">(BGR)</span></li>
<li data-icon="star">Bar Harbor, MAINE<span class="md-iata">(BHB)</span></li>
<li data-icon="star">Baton Rouge, LOUISIANA<span class="md-iata">(BTR)</span></li>
<!-- Showing partial data. Download full source. -->
</ul>
</div>
.md-navigate .md-list .mbsc-lv-item {
padding-right: 4em;
backface-visibility: hidden;
-webkit-transform: none;
-moz-transform: none;
transform: none;
}
.md-popup {
position: fixed;
width: 100px;
height: 100px;
margin: -50px 0 0 -50px;
border-radius: 100px;
background: rgba(78, 204, 196, .6);
color: #fff;
font-size: 56px;
font-family: sans-serif;
line-height: 100px;
text-align: center;
top: 50%;
left: 50%;
z-index: 10;
opacity: 0;
pointer-events: none;
-webkit-transition: opacity 300ms;
-moz-transition: opacity 300ms;
transition: opacity 300ms;
}
.md-show-popup {
opacity: 1;
}
.md-alfabet .mbsc-ms-item {
min-width: 2.5em;
}
.md-iata {
position: absolute;
top: 50%;
right: 1em;
margin-top: -9px;
}
.example-full .md-popup {
position: fixed;
}
.md-item-star .mbsc-ic-star3 {
font-size: 14px;
}
/* no bookmark section */
.md-navigate .md-list .mbsc-lv-item.md-no-bookmark {
display: none;
padding: 1.5em 2.5em;
height: 571px;
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
.md-nob-separator {
height: 1px;
margin-bottom: 38px;
width: 100%;
background: #CACACA;
}
.md-nob-title {
text-align: center;
padding: 1em;
font-size: 16px;
}
.md-nob-txt {
text-align: center;
padding: 1em 0 2em 0;
color: #a0a0a0;
font-size: 14px;
}
.md-navigate .mbsc-lv .md-no-bookmark.mbsc-lv-item .md-nob-img {
position: static;
display: block;
max-width: 274px;
width: 274px;
max-height: initial;
margin: 0 auto;
border: 1px solid #ccc;
margin-bottom: 14px;
transform: none;
}
.md-no-bookmark {
display: none;
padding: 2em;
background: #f7f7f7;
font-size: 16px;
}
.md-navigate .md-no-bookmark.mbsc-lv-item-active:after {
background: none !important;
}
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 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 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/8 or Ionic 2/3/4.
Use it when you are building your app or website with React.
Do you need additional support seats?
The license comes with one support seat. ( +$100/seat )
Add the source code?
What framework are you using?
We have to set you up with a trial for this to run 👍
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:
Step 3.Copy the code into your app.
Step 4.Run ionic serve in the root folder of your app 🎉
$ ionic serve
And voilà, everything should be running smoothly.
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 Angular project
$ mobiscroll config angular
$ mobiscroll config angular --lite
You will be prompted to log in with your mobiscroll account. Set your password here
Step 3.Copy the code into your app. HTML goes into the markup, TS into Typescript.
Step 4.Run ng serve in the root folder of your app 🎉
$ ng serve
And voilà, everything should be running smoothly.
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! 👍