Auto extender in mvc:
<link href="~/Scripts/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<link href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" rel="Stylesheet" />
<script src="../Scripts/jquery-ui-timepicker-addon.js"></script>
<link href="../Content/themes/base/images/jquery-ui-timepicker-addon.css" rel="stylesheet" />
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
Code:
<script type="text/javascript">
jQuery(document).ready(function ($) {
$('#FK_Store_Quotation_Receipt_No').focus(function () {
SearchQuoNo();
});
function SearchQuoNo() {
$('#FK_Store_Quotation_Receipt_No').autocomplete({
source: function (request, response) {
debugger;
var A = $('#FK_Store_Quotation_Receipt_No').val();
var B = $('#Stores_Supplier_Code').find(":selected").val();
$.ajax({
type: "Post",
url: "Get_Quotation_Numbers",
data: { FK_Store_Quotation_Receipt_No: A, Stores_Supplier_Code: B },
dataType: "json",
success: function (data) {
response($.map(data, function (item) {
return { label: item.Text, value: item.Text };
}));
},
error: function (Error) {
debugger;
alert('No Data Found.........!');
}
});
}
});
}
});
</script>
No comments:
Post a Comment