Add search box to list
This commit is contained in:
parent
56185c67c2
commit
4a3c7b3076
@ -38,6 +38,17 @@ $(".view-main").on("swipeout:delete", "#addresslist .package-list-item", functio
|
|||||||
deletePackage($(this).data("packageid"));
|
deletePackage($(this).data("packageid"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var searchbar = app.searchbar.create({
|
||||||
|
el: '.package-list-searchbar',
|
||||||
|
searchContainer: '#addresslist',
|
||||||
|
searchIn: '.item-title',
|
||||||
|
on: {
|
||||||
|
search(sb, query, previousQuery) {
|
||||||
|
console.log(query, previousQuery);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update package distances relative to the passed coordinates.
|
* Update package distances relative to the passed coordinates.
|
||||||
* @param {type} latitude
|
* @param {type} latitude
|
||||||
|
@ -14,6 +14,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="title">Packages</div>
|
<div class="title">Packages</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
|
<a class="link icon-only searchbar-enable" data-searchbar=".package-list-searchbar">
|
||||||
|
<i class="icon fas fa-search"></i>
|
||||||
|
</a>
|
||||||
<a class="link popover-open" data-popover="#popover-sort-list">
|
<a class="link popover-open" data-popover="#popover-sort-list">
|
||||||
<i class="icon fas fa-sort-amount-down-alt"></i>
|
<i class="icon fas fa-sort-amount-down-alt"></i>
|
||||||
</a>
|
</a>
|
||||||
@ -21,6 +24,16 @@
|
|||||||
<i class="icon fas fa-trash"></i>
|
<i class="icon fas fa-trash"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
<form class="searchbar searchbar-expandable package-list-searchbar">
|
||||||
|
<div class="searchbar-inner">
|
||||||
|
<div class="searchbar-input-wrap">
|
||||||
|
<input type="search" placeholder="Search"/>
|
||||||
|
<i class="searchbar-icon"></i>
|
||||||
|
<span class="input-clear-button"></span>
|
||||||
|
</div>
|
||||||
|
<span class="searchbar-disable-button">Cancel</span>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -37,6 +37,18 @@ var routes = [
|
|||||||
on: {
|
on: {
|
||||||
pageAfterIn: function () {
|
pageAfterIn: function () {
|
||||||
loadPackageList();
|
loadPackageList();
|
||||||
|
|
||||||
|
var searchbar = app.searchbar.create({
|
||||||
|
el: '.package-list-searchbar',
|
||||||
|
searchContainer: '#addresslist',
|
||||||
|
searchIn: '.item-title',
|
||||||
|
backdrop: false,
|
||||||
|
on: {
|
||||||
|
search(sb, query, previousQuery) {
|
||||||
|
console.log(query, previousQuery);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
keepAlive: true
|
keepAlive: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user