9a9a2279f965a3eef7c0690531fd317a3bce701c.svn-base 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. BemsWebApplication.InvestmentCost = function (params, viewInfo) {
  2. 'use strict';
  3. var eq = BWA.DataUtil.constructEqualFilter,
  4. and = BWA.DataUtil.andFilter
  5. ;
  6. var deferredForSearch = new $.Deferred();
  7. var dataSourceOptions = {
  8. select: [
  9. 'SiteId',
  10. 'InsvestmentCostId',
  11. 'Name',
  12. 'Comment',
  13. 'InsvestmentCost'
  14. ],
  15. //extendOptions: {
  16. // forceOriginalField: true
  17. //},
  18. filter: [
  19. ['SiteId', '=', BWA.UserInfo.SiteId()],
  20. ]
  21. };
  22. var viewModel = BWA.DataGrid.createViewWithDataGrid(params, viewInfo, 'FmsInvestmentCost', {
  23. dataSourceOptions: dataSourceOptions,
  24. columns: [
  25. { dataField: 'InsvestmentCostId', caption: $G('number'), width: '10%', alignment: 'center', allowFiltering: false, sortOrder: 'desc' },
  26. { dataField: 'Name', caption: '투자비항목', width: '30%', alignment: 'center' },
  27. { dataField: 'Comment', caption: '설명', width: '40%', alignment: 'center' },
  28. { dataField: 'InsvestmentCost', caption: '투자비용', width: '10%', alignment: 'center', format: 'currency' },
  29. ],
  30. summary: {
  31. totalItems: [
  32. //{
  33. // column: 'Name',
  34. // summaryType: 'count'
  35. //},
  36. {
  37. column: 'InsvestmentCost',
  38. summaryType: 'sum',
  39. valueFormat: "currency"
  40. }]
  41. },
  42. searchViewItems: [
  43. { id: 'Name' },
  44. { id: 'Comment' },
  45. ],
  46. handleAfterLoadingModelByKey: function (data, dataViewModel, isNewInPopup) {
  47. if (isNewInPopup() == false) {
  48. }
  49. },
  50. handleDataGridRowClick: function (id, dataGrid, clickRow, popupVisible) {
  51. dataGrid.clearSelection();
  52. var data = clickRow.data;
  53. //var dataModel = viewModel.dataModel;
  54. //if (data['FileId']() != null)
  55. // dataModel.AttachmentFileName(data['CmFile/Name']());
  56. //else dataModel.AttachmentFileName('');
  57. popupVisible(true);
  58. },
  59. handleViewShowing: function (dataModel) {
  60. },
  61. handlePopupShowing: function (isNewInPopup, dataViewModel) {
  62. // 신규등록인 경우
  63. if (isNewInPopup()) {
  64. }
  65. },
  66. handlePopupShown: function (isEditMode, isNew, dataViewModel) {
  67. },
  68. handleViewShown: function (dataViewModel, isEditModeInPopup) {
  69. },
  70. handleSaveSuccess: function () {
  71. },
  72. });
  73. // refresh?
  74. //viewModel.popupVisible.subscribe(function (value) {
  75. // if (!value) {
  76. // viewModel.gridView().refresh();
  77. // }
  78. //});
  79. return viewModel;
  80. };