* code for task#1423.

This commit is contained in:
chencongzhi520@gmail.com
2013-06-19 02:48:45 +00:00
parent 276f616253
commit dd03e4dd57
7 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -438,7 +438,7 @@ class product extends control
* @access public
* @return void
*/
public function dropMenu($productID, $module, $method, $extra)
public function ajaxGetDropMenu($productID, $module, $method, $extra)
{
$this->view->link = $this->getProductLink($module, $method, $extra);
$this->view->productID = $productID;
@@ -459,7 +459,7 @@ class product extends control
* @access public
* @return void
*/
public function searchItems($keywords, $module, $method, $extra)
public function ajaxGetMatchedItems($keywords, $module, $method, $extra)
{
$this->view->link = $this->getProductLink($module, $method, $extra);
$this->view->products = $this->dao->select('*')->from(TABLE_PRODUCT)->where('deleted')->eq(0)->andWhere('name')->like("%$keywords%")->orderBy('code')->fetchAll();
+2 -2
View File
@@ -1512,7 +1512,7 @@ class project extends control
* @access public
* @return void
*/
public function dropMenu($projectID, $module, $method, $extra)
public function ajaxGetDropMenu($projectID, $module, $method, $extra)
{
$this->view->link = $this->getProjectLink($module, $method, $extra);
$this->view->projectID = $projectID;
@@ -1533,7 +1533,7 @@ class project extends control
* @access public
* @return void
*/
public function searchItems($keywords, $module, $method, $extra)
public function ajaxGetMatchedItems($keywords, $module, $method, $extra)
{
$this->view->link = $this->getProjectLink($module, $method, $extra);
$this->view->projects = $this->dao->select('*')->from(TABLE_PROJECT)->where('deleted')->eq(0)->andWhere('name')->like("%$keywords%")->orderBy('code')->fetchAll();
+3 -3
View File
@@ -138,7 +138,7 @@ var showMenu = 0; //Showing or hiding drop menu.
function showDropMenu(objectType, objectID, module, method, extra)
{
if(showMenu == 1) { showMenu = 0; return $("#dropMenu").hide();};
$.get(createLink(objectType, 'dropMenu', "objectID=" + objectID + "&module=" + module + "&method=" + method + "&extra=" + extra), function(data){ $('#dropMenu').html(data);});
$.get(createLink(objectType, 'ajaxGetDropMenu', "objectID=" + objectID + "&module=" + module + "&method=" + method + "&extra=" + extra), function(data){ $('#dropMenu').html(data);});
var offset = $('#currentItem').offset();
$("#dropMenu").css({ top:offset.top + $('#currentItem').height() + "px", left:offset.left });
$("#dropMenu").show('fast', function(){$("#dropMenu #search").focus();});
@@ -163,11 +163,11 @@ function searchItems(keywords, objectType, objectID, module, method, extra)
{
showMenu = 0;
showDropMenu(objectType, objectID, module, method, extra);
setTimeout(function(){$("#dropMenu #search").focus();}, 500);
setTimeout(function(){$("#dropMenu #search").focus();}, 300);
}
else
{
if(keywords != '-') $.get(createLink(objectType, 'searchItems', "keywords=" + keywords + "&module=" + module + "&method=" + method + "&extra=" + extra), function(data){ $('#searchResult').html(data);});
if(keywords != '-') $.get(createLink(objectType, 'ajaxGetMatchedItems', "keywords=" + keywords + "&module=" + module + "&method=" + method + "&extra=" + extra), function(data){ $('#searchResult').html(data);});
}
}