html - keep search input at the top of list view in ionic framework -
i new ionic framework, experimenting now. on 1 of page, have search input followed list, looks this:
when scroll up, search field scrolling list view. possible keep search field fixed @ top whilst scrolling?
this html markup far:
<ion-view view-title="force"> <ion-content> <label class="item item-input"> <i class="icon ion-search placeholder-icon"></i> <input type="text" placeholder="search force" data-ng-model="searchforce"> </label> <div class="list"> <ion-item class="item-icon-right" ng-repeat="force in forces | filter:searchforce" type="item-text-wrap" href="#/tab/force/{{force.id}}"> {{force.name}} <i class="icon ion-chevron-right icon-accessory"></i> </ion-item> </div> </ion-content> </ion-view>
you can use sub-header this:
<ion-header-bar class="bar-light bar-subheader"> <input type="text" placeholder="search force" data-ng-model="searchforce"> <button ng-if="searchforce.length" class="button button-icon ion-android-close input-button" ng-click="clearsearch()"> </button> </ion-header-bar>
also see post alternatives: http://forum.ionicframework.com/t/how-to-make-search-bar-sticky/20721
Comments
Post a Comment