Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In my previous posts I have showed how to use bootstrap's drop-down menus with the Capabilities API. In this tutorial I will show you how to use jQuery's UI to get results as you type like this
<link rel="stylesheet" href="https://community.qlik.com//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
function refactorData(reply, app){
var data = [];
for (var i = 0; i < reply.qListObject.qDataPages[0].qMatrix.length; i++) {
data.push(reply.qListObject.qDataPages[0].qMatrix[0].qText);
}
$("#search").autocomplete({
source: data
});
};
$( "#searchBtn" ).on( 'click', function () {
app.field('Case Owner').selectValues([$('#search').val()], false, false);
});
<div class="col-sm-4 qvplaceholder" id="QV01">
<div class="input-group input-group-sm">
<input type="text" class="form-control" placeholder="Type in the Case Owner" aria-describedby="basic-addon1" id="search" name="search">
<span class="input-group-btn">
<button class="btn btn-default" type="button" id="searchBtn"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> Search</button>
</span>
</div>
</div>
And that's it. The final should look like this
YV
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.