Moved ledgers over the jqGrid. Working reasonably well at the moment.

git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605@131 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-06-15 06:22:38 +00:00
parent 3dcdcb03eb
commit 39071b39fb
6 changed files with 132 additions and 168 deletions

View File

@@ -7,16 +7,18 @@ if (!isset($limit))
$limit = 20;
if (!isset($limitOptions)) {
$limitOptions = array();
$limitOptions = array($limit);
if ($limit < 10)
array_push($limitOptions, 2, 5);
if ($limit < 30)
array_push($limitOptions, 10, 25);
if ($limit > 10)
array_push($limitOptions, 50, 200);
array_push($limitOptions, 25, 50, 200);
if ($limit > 20)
array_push($limitOptions, 500);
}
sort($limitOptions, SORT_NUMERIC);
$limitOptions = array_unique($limitOptions, SORT_NUMERIC);
if (!isset($height))
$height = 'auto';
@@ -130,6 +132,10 @@ foreach ($jqGridColumns AS &$col) {
$col = array_merge($default, $col);
}
reset($jqGridColumns);
$sortname = current($jqGridColumns);
$sortname = $sortname['index'];
// OK, now that everything is in place, get out of PHP mode,
// and add the javascript code (along with a touch of HTML)
@@ -163,12 +169,14 @@ jQuery(document).ready(function(){
'height' => $height,
'rowNum' => $limit,
'rowList' => $limitOptions,
'sortname' => $sortname,
'caption' => $caption,
'imgpath' => $imgpath,
'viewrecords' => true,
'pager' => $grid_id.'-pager',
'loadComplete' => array('--special' => "function() {url=jQuery('#{$grid_id}').getGridParam('url');url=url.replace(/\/debug.*$/,'?'); pd=jQuery('#{$grid_id}').getPostData();$.each(pd,function(i){ url+=i+'='+escape(pd[i])+'&'; }); jQuery('#{$grid_id}-query').html('<A HREF=\"'+url+'\">Grid Query</A><BR>'+url);}"),
'loadError' => array('--special' => "function(xhr,st,err) {url=jQuery('#{$grid_id}').getGridParam('url');url=url.replace(/\/debug.*$/,'?'); pd=jQuery('#{$grid_id}').getPostData();$.each(pd,function(i){ url+=i+'='+escape(pd[i])+'&'; }); jQuery('#{$grid_id}-query').html('<A HREF=\"'+url+'\">Grid Error Query</A><BR>'+url);}"),
//'toolbar' => array(true,"bottom"),
)); ?>
);