123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- BemsWebApplication.InvestmentCost = function (params, viewInfo) {
- 'use strict';
- var eq = BWA.DataUtil.constructEqualFilter,
- and = BWA.DataUtil.andFilter
- ;
- var deferredForSearch = new $.Deferred();
- var dataSourceOptions = {
- select: [
- 'SiteId',
- 'InsvestmentCostId',
- 'Name',
- 'Comment',
- 'InsvestmentCost'
- ],
- //extendOptions: {
- // forceOriginalField: true
- //},
- filter: [
- ['SiteId', '=', BWA.UserInfo.SiteId()],
- ]
- };
- var viewModel = BWA.DataGrid.createViewWithDataGrid(params, viewInfo, 'FmsInvestmentCost', {
- dataSourceOptions: dataSourceOptions,
- columns: [
- { dataField: 'InsvestmentCostId', caption: $G('number'), width: '10%', alignment: 'center', allowFiltering: false, sortOrder: 'desc' },
- { dataField: 'Name', caption: '투자비항목', width: '30%', alignment: 'center' },
- { dataField: 'Comment', caption: '설명', width: '40%', alignment: 'center' },
- { dataField: 'InsvestmentCost', caption: '투자비용', width: '10%', alignment: 'center', format: 'currency' },
- ],
- summary: {
- totalItems: [
- //{
- // column: 'Name',
- // summaryType: 'count'
- //},
- {
- column: 'InsvestmentCost',
- summaryType: 'sum',
- valueFormat: "currency"
- }]
- },
- searchViewItems: [
- { id: 'Name' },
- { id: 'Comment' },
- ],
- handleAfterLoadingModelByKey: function (data, dataViewModel, isNewInPopup) {
- if (isNewInPopup() == false) {
- }
- },
- handleDataGridRowClick: function (id, dataGrid, clickRow, popupVisible) {
- dataGrid.clearSelection();
- var data = clickRow.data;
- //var dataModel = viewModel.dataModel;
- //if (data['FileId']() != null)
- // dataModel.AttachmentFileName(data['CmFile/Name']());
- //else dataModel.AttachmentFileName('');
- popupVisible(true);
- },
- handleViewShowing: function (dataModel) {
- },
- handlePopupShowing: function (isNewInPopup, dataViewModel) {
- // 신규등록인 경우
- if (isNewInPopup()) {
- }
- },
- handlePopupShown: function (isEditMode, isNew, dataViewModel) {
-
- },
- handleViewShown: function (dataViewModel, isEditModeInPopup) {
- },
- handleSaveSuccess: function () {
- },
- });
- // refresh?
- //viewModel.popupVisible.subscribe(function (value) {
- // if (!value) {
- // viewModel.gridView().refresh();
- // }
- //});
- return viewModel;
- };
|