Hello I am using Laravel 4..
I want to use Jquery Autocomplete,So I have used Code as below:
$("#txtQualityNo").autocomplete({
dataType: 'json',
source: availableTags
minLength: 3,
dataType: 'json',
source: '/purchaseorder?autoQualityNo=' + $(this).val() + '&companyMillSelected=' + $companyMillSelected,
focus: function (event, ui) {
// $( "#project" ).val( ui.item.label );
return false;
},
select: function (event, ui) {
$("#txtQualityNo").val(ui.item.qualityno);
$("#txtShadeNo").val(ui.item.shadeno);
return false;
}
})
.data("ui-autocomplete")._renderItem = function (ul, item) {
return $("<li>")
.append("<a>" + item.qualityno + "#" + item.shadeno + "</a>")
.appendTo(ul);
};
In Controller I have used code:
if (Request::ajax() && Input::has('autoQualityNo')) {
$records = DB::table('blah') - > get(array('qualityno', 'shadeno', 'stockid'));
return Response::json($records);
}
So it shows Request time as 0ms,waiting time as 1.15 secs and response time as 5 ms
So for autocomplete this time is too much
Does any one have idea regarding this ?