"Multi Select Tiled Layout"
Bootstrap 3.3.0 Snippet by prateek

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <h2>Multiple Select with Search Option - Tiled Layout </h2> <div class="form-group"> <div class="col-sm-12 col-md-12 col-lg-12"> <input type="search" class="form-control" id="search" placeholder="Add your options.."> </div> </div> </div> <div class="row"> <div class="form-group"> <div class="searchable-container"> <div class="items col-xs-5 col-sm-5 col-md-3 col-lg-3"> <div class="info-block block-info clearfix"> <div class="square-box pull-left"> <span class="glyphicon glyphicon-tags glyphicon-lg"></span> </div> <div data-toggle="buttons" class="btn-group bizmoduleselect"> <label class="btn btn-default"> <div class="bizcontent"> <input type="checkbox" name="var_id[]" autocomplete="off" value=""> <span class="glyphicon glyphicon-ok glyphicon-lg"></span> <h5>Coffee</h5> </div> </label> </div> </div> </div> <div class="items col-xs-5 col-sm-5 col-md-3 col-lg-3"> <div class="info-block block-info clearfix"> <div class="square-box pull-left"> <span class="glyphicon glyphicon-tags glyphicon-lg"></span> </div> <div data-toggle="buttons" class="btn-group bizmoduleselect"> <label class="btn btn-default"> <div class="bizcontent"> <input type="checkbox" name="var_id[]" autocomplete="off" value=""> <span class="glyphicon glyphicon-ok glyphicon-lg"></span> <h5>Tea</h5> </div> </label> </div> </div> </div> <div class="items col-xs-5 col-sm-5 col-md-3 col-lg-3"> <div class="info-block block-info clearfix"> <div class="square-box pull-left"> <span class="glyphicon glyphicon-tags glyphicon-lg"></span> </div> <div data-toggle="buttons" class="btn-group bizmoduleselect"> <label class="btn btn-default"> <div class="bizcontent"> <input type="checkbox" name="var_id[]" autocomplete="off" value=""> <span class="glyphicon glyphicon-ok glyphicon-lg"></span> <h5>Fruit Juice</h5> </div> </label> </div> </div> </div> </div> </div> </div> </div>
.searchable-container{margin:20px 0 0 0} .searchable-container label.btn-default.active{background-color:#007ba7;color:#FFF} .searchable-container label.btn-default{width:90%;border:1px solid #efefef;margin:5px; box-shadow:5px 8px 8px 0 #ccc;} .searchable-container label .bizcontent{width:100%;} .searchable-container .btn-group{width:90%} .searchable-container .btn span.glyphicon{ opacity: 0; } .searchable-container .btn.active span.glyphicon { opacity: 1; }
$(function() { $('#search').on('keyup', function() { var pattern = $(this).val(); $('.searchable-container .items').hide(); $('.searchable-container .items').filter(function() { return $(this).text().match(new RegExp(pattern, 'i')); }).show(); }); });

Related: See More


Questions / Comments:

Hi Prateek,

This is an awesome snippet. I am trying to replicate it on my angular js application. I am able to get the CSS in place, so when I hover mouse on the tiles, The background color changes to grey, but when I click it I cannot see a CHECK and background color change?

On this line : <div data-toggle="buttons" class="btn-group bizmoduleselect">

I am not able to find out bizmoduleselect class. Can you please help me with that. I have created a plunker : http://plnkr.co/edit/jwOwAb....

Please help me with that

shoeb sayyed () - 3 years ago - Reply 0


Hi Shoeb, Really sorry to be seeing your message late. I am sure you would have been able to identify the issue by now. In case if you haven't, I saw your code on plnkr - There are some dependancies on jQuery for bootstrap js. So all you have to do is to include a jQuery somewhere in the <head> :

<script src="//ajax.googleapis.com/ajax/li..."></script>
This should fix it.
Thanks

PC () - 3 years ago - Reply 0