cmc-sales/app/webroot/js/search.js

65 lines
912 B
JavaScript
Raw Normal View History

2010-05-10 22:02:11 -07:00
/*
* file: search.js
* Powers AJAX search of records in the CMC Sales System.
*
*
*/
$(function() {
2010-05-30 22:54:44 -07:00
$("#ajaxLoading").hide();
2010-05-30 22:54:44 -07:00
$("#ajaxLoading").bind("ajaxSend", function() {
$(this).show();
}).bind("ajaxComplete", function() {
$(this).hide();
});
2010-05-30 22:54:44 -07:00
$("#dialogDiv").hide();
2010-05-10 22:02:11 -07:00
2010-05-30 22:54:44 -07:00
$("#dialogDiv").dialog({
autoOpen: false,
width: 900,
modal: true
2010-05-30 22:54:44 -07:00
});
2010-05-30 22:54:44 -07:00
$("#searchLink").click(function() {
2010-05-30 22:54:44 -07:00
$("#dialogDiv").dialog('open');
return false;
});
2010-05-10 22:02:11 -07:00
$("#searchButton").button().click(function() {
doSearch();
return false;
});
2010-05-30 22:54:44 -07:00
$("#dialogDiv").bind("dialogclose", function() {
$("#results").empty();
})
2010-05-10 22:02:11 -07:00
});
function doSearch() {
$.post("/enquiries/doSearch", $("#searchString").serialize(), function(data) {
$("#results").html(data);
});
}
2010-05-10 22:02:11 -07:00