* fix unable to reorder in dynamic view, bug #21046.

This commit is contained in:
Wenrui LI
2022-03-25 11:05:46 +08:00
parent 1ea49388a3
commit c3d025f199
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -204,7 +204,8 @@ class company extends control
$pager = new pager($recTotal, $recPerPage = 50, $pageID = 1);
/* Append id for secend sort. */
$orderBy = $direction == 'next' ? 'date_desc' : 'date_asc';
if($direction == 'next') $orderBy = 'date_desc';
if($direction == 'pre') $orderBy = 'date_asc';
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
$date = empty($date) ? '' : date('Y-m-d', $date);
@@ -288,7 +289,6 @@ class company extends control
$this->view->pager = $pager;
$this->view->userID = $userID;
$this->view->param = $param;
$this->view->browseType = $browseType;
$this->view->dateGroups = $this->action->buildDateGroup($actions, $direction, $browseType, $orderBy);
$this->view->direction = $direction;
$this->display();
+2 -2
View File
@@ -1,12 +1,12 @@
$('#account, #product, #project, #execution, #orderBy').change(function()
{
var userID = $('#account').val();
var productID = $('#product').val();
var productID = $('#product').length ? $('#product').val() : 0;
var projectID = systemMode == 'new' ? $('#project').val() : 0;
var executionID = $('#execution').val();
var orderBy = $('#orderBy').val();
browseType = browseType == 'bysearch' ? 'all' : browseType;
link = createLink('company', 'dynamic', 'browseType=' + browseType + '&param=&recTotal=0&date=&direction=next&userID=' + userID + '&productID=' + productID + '&projectID=' + projectID + '&executionID=' + executionID + '&orderBy=' + orderBy);
link = createLink('company', 'dynamic', 'browseType=' + browseType + '&param=&recTotal=0&date=&direction=no&userID=' + userID + '&productID=' + productID + '&projectID=' + projectID + '&executionID=' + executionID + '&orderBy=' + orderBy);
location.href = link;
})