本文整理汇总了PHP中DataGrid::initDataGridJS方法的典型用法代码示例。如果您正苦于以下问题:PHP DataGrid::initDataGridJS方法的具体用法?PHP DataGrid::initDataGridJS怎么用?PHP DataGrid::initDataGridJS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataGrid
的用法示例。
在下文中一共展示了DataGrid::initDataGridJS方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showSelectPage
function showSelectPage()
{
global $tpl;
global $us;
global $badgerDb;
handleOldFinishedTransactions(new AccountManager($badgerDb));
$widgets = new WidgetEngine($tpl);
$widgets->addCalendarJS();
$widgets->addToolTipJS();
$tpl->addJavaScript("js/behaviour.js");
$tpl->addJavaScript("js/prototype.js");
$tpl->addJavaScript("js/statistics.js");
$tpl->addHeaderTag('<script type="text/javascript">var badgerHelpChapter = "Statistiken";</script>');
$dataGrid = new DataGrid($tpl);
$dataGrid->sourceXML = BADGER_ROOT . "/core/XML/getDataGridXML.php?q=AccountManager";
$dataGrid->headerName = array(getBadgerTranslation2('statistics', 'accColTitle'), getBadgerTranslation2('statistics', 'accColBalance'), getBadgerTranslation2('statistics', 'accColCurrency'));
$dataGrid->columnOrder = array("title", "balance", 'currency');
$dataGrid->initialSort = "title";
$dataGrid->initialSortDirection = "asc";
$dataGrid->headerSize = array(160, 100, 75);
$dataGrid->cellAlign = array("left", 'right', 'left');
$dataGrid->width = '30em';
$dataGrid->height = '7em';
$dataGrid->initDataGridJS();
try {
$preselectedAccounts = $us->getProperty('statisticsPreselectedAccounts');
foreach ($preselectedAccounts as $currentPreselectedAccount) {
$tpl->addOnLoadEvent("dgPreselectId('{$currentPreselectedAccount}');");
}
} catch (BadgerException $ex) {
}
$tpl->addOnLoadEvent("Behaviour.register(statisticsBehaviour);");
$tpl->addOnLoadEvent("Behaviour.apply();");
$widgets->addNavigationHead();
$selectTitle = getBadgerTranslation2('statistics', 'pageTitle');
echo $tpl->getHeader($selectTitle);
$widgets->addToolTipLayer();
$selectFormAction = BADGER_ROOT . '/modules/statistics/statistics.php';
$graphTypeText = getBadgerTranslation2('statistics', 'type');
$categoryTypeText = getBadgerTranslation2('statistics', 'category');
$timeFrameText = getBadgerTranslation2('statistics', 'period');
$summarizeCategoriesText = getBadgerTranslation2('statistics', 'catMerge');
$accountsText = getBadgerTranslation2('statistics', 'accounts');
$differentCurrencyWarningText = getBadgerTranslation2('statistics', 'attention');
$fromText = getBadgerTranslation2('statistics', 'from');
$toText = getBadgerTranslation2('statistics', 'to');
$trendRadio = $widgets->createField('mode', null, 'trendPage', '', false, 'radio', 'checked="checked"');
$trendLabel = $widgets->createLabel('mode', getBadgerTranslation2('statistics', 'trend'));
$categoryRadio = $widgets->createField('mode', null, 'categoryPage', '', false, 'radio');
$categoryLabel = $widgets->createLabel('mode', getBadgerTranslation2('statistics', 'categories'));
$accountSelect = $dataGrid->writeDataGrid();
$accountField = $widgets->createField('accounts', null, null, '', false, 'hidden');
$monthArray = array('fullYear' => getBadgerTranslation2('statistics', 'fullYear'), '1' => getBadgerTranslation2('statistics', 'jan'), '2' => getBadgerTranslation2('statistics', 'feb'), '3' => getBadgerTranslation2('statistics', 'mar'), '4' => getBadgerTranslation2('statistics', 'apr'), '5' => getBadgerTranslation2('statistics', 'may'), '6' => getBadgerTranslation2('statistics', 'jun'), '7' => getBadgerTranslation2('statistics', 'jul'), '8' => getBadgerTranslation2('statistics', 'aug'), '9' => getBadgerTranslation2('statistics', 'sep'), '10' => getBadgerTranslation2('statistics', 'oct'), '11' => getBadgerTranslation2('statistics', 'nov'), '12' => getBadgerTranslation2('statistics', 'dec'));
$monthSelect = $widgets->createSelectField('monthSelect', $monthArray, 'fullYear', '', false, 'onchange="updateDateRange();"');
$now = new Date();
$beginOfYear = new Date();
$beginOfYear->setMonth(1);
$beginOfYear->setDay(1);
$yearInput = $widgets->createField('yearSelect', 4, $now->getYear(), '', false, 'text', 'onchange="updateDateRange();"');
$startDateField = $widgets->addDateField("startDate", $beginOfYear->getFormatted());
$endDateField = $widgets->addDateField("endDate", $now->getFormatted());
$inputRadio = $widgets->createField('type', null, 'i', '', false, 'radio', 'checked="checked"');
$inputLabel = $widgets->createLabel('type', getBadgerTranslation2('statistics', 'income'));
$outputRadio = $widgets->createField('type', null, 'o', '', false, 'radio');
$outputLabel = $widgets->createLabel('type', getBadgerTranslation2('statistics', 'expenses'));
$summarizeRadio = $widgets->createField('summarize', null, 't', '', false, 'radio', 'checked="checked"');
$summarizeLabel = $widgets->createLabel('summarize', getBadgerTranslation2('statistics', 'subCat'));
$distinguishRadio = $widgets->createField('summarize', null, 'f', '', false, 'radio');
$distinguishLabel = $widgets->createLabel('summarize', getBadgerTranslation2('statistics', 'subCat2'));
$dateFormatField = $widgets->createField('dateFormat', null, $us->getProperty('badgerDateFormat'), null, false, 'hidden');
$errorMsgAccountMissingField = $widgets->createField('errorMsgAccountMissing', null, getBadgerTranslation2('statistics', 'errorMissingAcc'), null, false, 'hidden');
$errorMsgStartBeforeEndField = $widgets->createField('errorMsgStartBeforeEnd', null, getBadgerTranslation2('statistics', 'errorDate'), null, false, 'hidden');
$errorMsgEndInFutureField = $widgets->createField('errorMsgEndInFuture', null, getBadgerTranslation2('statistics', 'errorEndDate'), null, false, 'hidden');
$submitButton = $widgets->createButton('submit', getBadgerTranslation2('statistics', 'showButton'), 'submitSelect();', "Widgets/accept.gif");
eval('echo "' . $tpl->getTemplate('statistics/select') . '";');
eval('echo "' . $tpl->getTemplate('badgerFooter') . '";');
}
示例2: WidgetEngine
$widgets = new WidgetEngine($tpl);
$widgets->addToolTipJS();
$widgets->addCalendarJS();
$widgets->addTwistieSectionJS();
$dataGrid = new DataGrid($tpl, "Account{$accountID}");
$dataGrid->sourceXML = BADGER_ROOT . "/core/XML/getDataGridXML.php?q=Account&qp={$accountID}";
$dataGrid->headerName = array(getBadgerTranslation2('accountOverview', 'colValutaDate'), getBadgerTranslation2('accountOverview', 'colTitle'), getBadgerTranslation2('accountOverview', 'colType'), getBadgerTranslation2('accountOverview', 'colAmount'), getBadgerTranslation2('accountOverview', 'colBalance'), getBadgerTranslation2('accountOverview', 'colCategoryTitle'));
$dataGrid->columnOrder = array("valutaDate", "title", "type", "amount", "balance", "concatCategoryTitle");
$dataGrid->height = "350px";
$dataGrid->headerSize = array(90, 350, 39, 80, 120, 200);
$dataGrid->cellAlign = array("left", "left", "center", "right", "right", "left");
$dataGrid->deleteRefreshType = "refreshDataGrid";
$dataGrid->deleteAction = "Transaction.php?action=delete&accountID={$accountID}&ID=";
$dataGrid->editAction = "Transaction.php?action=edit&accountID={$accountID}&ID=";
$dataGrid->newAction = "Transaction.php?action=new&accountID={$accountID}";
$dataGrid->initDataGridJS();
$widgets->addNavigationHead();
echo $tpl->getHeader($pageTitle);
// DataGrid Filter
$legendFilter = getBadgerTranslation2('dataGrid', 'filterLegend');
$datagGridFilterArray = $dataGrid->getNumberFilterSelectArray();
$datagGridStringFilterArray = $dataGrid->getStringFilterSelectArray();
$datagGridDateFilterArray = $dataGrid->getDateFilterSelectArray();
$titleLabel = $widgets->createLabel("title", getBadgerTranslation2('accountTransaction', 'title'), false);
$titleField = $widgets->createField("title", 30, "", "", false, "text", "");
$titleFilterOperator = $widgets->createSelectField("titleFilter", $datagGridStringFilterArray, "", "", false, "style='width: 95px;'");
$valutaDateLabel = $widgets->createLabel("valutaDate", getBadgerTranslation2('accountTransaction', 'valutaDate'), false);
$valutaDateField = $widgets->addDateField("valutaDate", "");
$valutaDateFilterOperator = $widgets->createSelectField("valutaDateFilter", $datagGridDateFilterArray, "", "", false, "style='width: 95px;'");
$amountLabel = $widgets->createLabel("amount", getBadgerTranslation2('accountTransaction', 'amount'), false);
$amountField = $widgets->createField("amount", 14, "", "", false, "text", "");
示例3: array
$dgAccounts->cellAlign = array('left', 'right', 'left');
$dgAccounts->width = '30em';
$dgAccounts->height = '7em';
$dgAccounts->discardSelectedRows = true;
$dgAccounts->initDataGridJS();
$dgResult = new DataGrid($tpl, 'Statistics2Result');
$dgResult->sourceXML = '';
//BADGER_ROOT . '/core/XML/getDataGridXML.php?q=MultipleAccounts&qp=1';
$dgResult->headerName = array(getBadgerTranslation2('statistics2', 'colAccountName'), getBadgerTranslation2('accountOverview', 'colValutaDate'), getBadgerTranslation2('accountOverview', 'colTitle'), getBadgerTranslation2('accountOverview', 'colAmount'), getBadgerTranslation2('accountOverview', 'colCategoryTitle'));
$dgResult->columnOrder = array('accountTitle', 'valutaDate', 'title', 'amount', 'concatCategoryTitle');
$dgResult->height = "350px";
$dgResult->headerSize = array(200, 90, 350, 80, 200);
$dgResult->cellAlign = array('left', 'left', 'left', 'right', 'left');
$dgResult->deleteRefreshType = 'refreshDataGrid';
$dgResult->discardSelectedRows = true;
$dgResult->initDataGridJS();
$widgets->addNavigationHead();
$pageTitle = getBadgerTranslation2('statistics2', 'pageTitle');
$tpl->addOnLoadEvent('loadPageSettingNamesList(); loadPageSetting(true);');
echo $tpl->getHeader($pageTitle);
$widgets->addToolTipLayer();
$dataGridFilterArray = DataGrid::getNumberFilterSelectArray();
$dataGridDateFilterArray = DataGrid::getDateFilterSelectArray();
$dataGridStringFilterArray = DataGrid::getStringFilterSelectArray();
$pageSettingsContent = $widgets->createSelectField('pageSettingsSelect', array(), '', '', false, 'onchange="loadPageSetting();"') . ' ' . $widgets->createButton('pageSettingSave', getBadgerTranslation2('statistics2', 'pageSettingSave'), 'savePageSetting();') . ' ' . $widgets->createButton('pageSettingDelete', getBadgerTranslation2('statistics2', 'pageSettingDelete'), 'deletePageSetting();');
$pageSettingsTwistie = $widgets->addTwistieSection(getBadgerTranslation2('statistics2', 'pageSettingsTwistieTitle'), $pageSettingsContent);
$pageSettingJS = '<script type="text/javascript">var newNamePrompt = "' . getBadgerTranslation2('statistics2', 'pageSettingNewNamePrompt') . '";</script>';
$filters['unselected'] = '';
$filters['title'] = getBadgerTranslation2('statistics2', 'titleFilter') . $widgets->createSelectField("titleOperator{$FILTER_ID_MARKER}", $dataGridStringFilterArray, "", "", false, "style='width: 95px;'") . ' ' . $widgets->createField("title{$FILTER_ID_MARKER}", 30, "", "", false, "text", "");
$filters['description'] = getBadgerTranslation2('statistics2', 'descriptionFilter') . $widgets->createSelectField("descriptionOperator{$FILTER_ID_MARKER}", $dataGridStringFilterArray, "", "", false, "style='width: 95px;'") . ' ' . $widgets->createField("description{$FILTER_ID_MARKER}", 30, "", "", false, "text", "");
$filters['valutaDate'] = getBadgerTranslation2('statistics2', 'valutaDateFilter') . $widgets->createSelectField("valutaDateOperator{$FILTER_ID_MARKER}", $dataGridDateFilterArray, "", "", false, "style='width: 95px;'") . ' ' . $widgets->addDateField("valutaDate{$FILTER_ID_MARKER}", "");