f6a8d89c63a0babf14b9bf4bdf49c04276246fd2.svn-base 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654
  1. (function () {
  2. 'use strict';
  3. BWA.View = BWA.View || {};
  4. BWA.View.Facility = BWA.View.Facility || {};
  5. BWA.View.Facility.createCodeClassView = function (params, viewInfo, options) {
  6. var dbModelId = options.dbModelId,
  7. selectedClassNameTitle = options.selectedClassNameTitle,
  8. classIdFieldName = [options.classId, 'ClassId'].join(''),
  9. parentClassIdFieldName = ['Parent', options.classId, 'ClassId'].join(''),
  10. viewModelName = ['Fms', options.classId, 'CodeClassViewModel'].join('');
  11. var initialized = false,
  12. shouldReload = false,
  13. dataViewModel = new BemsWebApplication[viewModelName](),
  14. isNewInPopup = ko.observable(false),
  15. isEditModeInPopup = ko.observable(false),
  16. viewModeInPopup = ko.observable(true),
  17. selectedClassName = ko.observable(selectedClassNameTitle),
  18. visibleCancelButton = ko.observable(false),
  19. selectedIds = [{}, {}, {}],
  20. selectedId = null,
  21. viewModel,
  22. hasnotModificationPermission,
  23. gridViews = [],
  24. popupVisible = ko.observable(false),
  25. disabledUpdateButton = ko.observable(true),
  26. disabledInsertButtons = [ko.observable(false), ko.observable(true), ko.observable(true)],
  27. dataSources = [];
  28. var selectedClassDepth = 0,
  29. backupSelectedClassDepth = 0;
  30. var isClass3 = ko.observable(false);
  31. var commandInsertButtonOptions = [{
  32. id: 'create1',
  33. title: '대분류 등록',
  34. disabled: disabledInsertButtons[0],
  35. action: function () {
  36. setInsertPopupInfo(0, null);
  37. }
  38. }, {
  39. id: 'create2',
  40. title: '중분류 등록',
  41. disabled: disabledInsertButtons[1],
  42. action: function () {
  43. setInsertPopupInfo(1, selectedIds[0][classIdFieldName]);
  44. }
  45. }, {
  46. id: 'create3',
  47. title: '소분류 등록',
  48. disabled: disabledInsertButtons[2],
  49. action: function () {
  50. setInsertPopupInfo(2, selectedIds[1][classIdFieldName]);
  51. }
  52. }];
  53. var commandUpdateButtonOption = {
  54. id: 'edit',
  55. title: '수정',
  56. disabled: disabledUpdateButton,
  57. action: function () {
  58. isNewInPopup(false);
  59. isClass3(selectedClassDepth === 2);
  60. popupVisible(true);
  61. }
  62. };
  63. var FmsFacilityCodeClassDataSource = BemsWebApplication.db.createDataSource('FmsFacilityCodeClass');
  64. var FmsMaterialCodeClassDataSource = BemsWebApplication.db.createDataSource('FmsMaterialCodeClass');
  65. var FmsFacilityCodeClassInfo = ko.observableArray();
  66. var FmsMaterialCodeClassInfo = ko.observableArray();
  67. var RowName;
  68. function handleModification() {
  69. shouldReload = true;
  70. }
  71. function handleSelectionChanged(selectedRowsInfo) {
  72. //var id = $(selectedRowsInfo.element).attr('id');
  73. //console.log(selectedRowsInfo.selectedRowKeys.length);
  74. //var isNotExistSelectedRow = (selectedRowsInfo.selectedRowKeys.length === 0);
  75. //var classDepth = Number(id.replace('gridContainer', '')) - 1;
  76. //if (classDepth < 2) {
  77. // disabledInsertButtons[classDepth + 1](isNotExistSelectedRow);
  78. //}
  79. refreshAllStatus();
  80. }
  81. function refreshAllStatus() {
  82. var isSelected = false;
  83. var names = [];
  84. selectedClassDepth = 0;
  85. for (var i = 0 ; i < gridViews.length ; i++) {
  86. var rows = gridViews[i].getSelectedRowsData();
  87. if (_.isEmpty(rows) === false) {
  88. var row = rows[0];
  89. selectedClassDepth = i;
  90. isSelected = true;
  91. selectedIds[i].SiteId = row.SiteId();
  92. selectedIds[i][classIdFieldName] = row[classIdFieldName]();
  93. if (i < 2) {
  94. disabledInsertButtons[i + 1](false);
  95. }
  96. names.push(row.Name());
  97. }
  98. else {
  99. delete selectedIds[i].SiteId;
  100. delete selectedIds[i][classIdFieldName];
  101. if (i < 2) {
  102. disabledInsertButtons[i + 1](true);
  103. }
  104. }
  105. }
  106. if (hasnotModificationPermission()) {
  107. for (var i = 0 ; i < 3 ; i++) {
  108. disabledInsertButtons[i](true);
  109. }
  110. disabledUpdateButton(true);
  111. }
  112. else {
  113. disabledUpdateButton(isSelected === false);
  114. }
  115. selectedClassName([selectedClassNameTitle, names.join(' /')].join(' '));
  116. }
  117. function handleViewShown() {
  118. if (hasnotModificationPermission()) {
  119. for (var i = 0 ; i < 3 ; i++) {
  120. disabledInsertButtons[i](true);
  121. }
  122. disabledUpdateButton(true);
  123. }
  124. if (shouldReload) {
  125. shouldReload = false;
  126. refreshList();
  127. //for (var i = 0 ; i < 3 ; i++) {
  128. // dataSources[i].pageIndex(0);
  129. // dataSources[i].load();
  130. //}
  131. }
  132. if (initialized === false) {
  133. for (var j = 0 ; j < 3 ; j++) {
  134. var dataGridOptions = j == 2 ? {
  135. columns: [
  136. { dataField: 'Abbreviation', caption: $G('abbreviation'), width: '20%', alignment: 'center' },
  137. { dataField: 'Name', caption: $G('className'), width: '50%', alignment: 'center' },
  138. utils.datagrid.columnIsUse('30%')
  139. ]
  140. } : {
  141. columns: [
  142. { dataField: 'Abbreviation', caption: $G('abbreviation'), width: '30%', alignment: 'center' },
  143. { dataField: 'Name', caption: $G('className'), width: '70%', alignment: 'center' }
  144. ]
  145. };
  146. dataGridOptions.selectedSourceItem = dataViewModel;
  147. dataGridOptions.dbId = dbModelId;
  148. dataGridOptions.selectedId = selectedIds[j];
  149. dataGridOptions.datagridId = 'gridContainer' + (j + 1);
  150. dataGridOptions.selectionChanged = handleSelectionChanged;
  151. dataGridOptions.handleDataGridRowClick = handleDataGridRowClick;
  152. var id = ['#', 'gridContainer', (j + 1)].join('');
  153. dataGridOptions = utils.datagrid.defaultOptions(dataGridOptions);
  154. $(id).dxDataGrid(dataGridOptions);
  155. gridViews[j] = $(id).dxDataGrid('instance');
  156. }
  157. $("#gridContainer1").dxDataGrid({
  158. paging: {
  159. pageSize: 19
  160. }
  161. });
  162. $("#gridContainer2").dxDataGrid({
  163. paging: {
  164. pageSize: 19
  165. }
  166. });
  167. $("#gridContainer3").dxDataGrid({
  168. paging: {
  169. pageSize: 19
  170. }
  171. });
  172. refreshDataSource(0, null);
  173. initialized = true;
  174. }
  175. }
  176. function refreshDataSource(depth, parentId) {
  177. dataSources[depth].filter([parentClassIdFieldName, '=', parentId], 'and', ['SiteId', '=', BWA.UserInfo.SiteId()]); //**kgpark
  178. dataSources[depth].load().done(function (array) {
  179. gridViews[depth].option('dataSource', array);
  180. gridViews[depth].refresh();
  181. });
  182. }
  183. function handleDataGridRowClick(id, dataGrid, clickRow) {
  184. switch (id) {
  185. case 'gridContainer1':
  186. refreshDataSource(1, clickRow.data[classIdFieldName]());
  187. refreshDataSource(2, -1);
  188. break;
  189. case 'gridContainer2':
  190. refreshDataSource(2, clickRow.data[classIdFieldName]());
  191. break;
  192. case 'gridContainer3':
  193. break;
  194. }
  195. if (dbModelId == 'FmsFacilityCodeClass') {
  196. FmsFacilityCodeClassDataSource.filter([
  197. ["SiteId", "=", BWA.UserInfo.SiteId()],
  198. "and",
  199. ["Depth", "=", clickRow.data.Depth()],
  200. "and",
  201. ["ParentFacilityClassId", "=", clickRow.data.ParentFacilityClassId()]
  202. ]);
  203. FmsFacilityCodeClassDataSource.load().done(function (result) {
  204. FmsFacilityCodeClassInfo(result);
  205. });
  206. }
  207. else if (dbModelId == 'FmsMaterialCodeClass') {
  208. FmsMaterialCodeClassDataSource.filter([
  209. ["SiteId", "=", BWA.UserInfo.SiteId()],
  210. "and",
  211. ["Depth", "=", clickRow.data.Depth()],
  212. "and",
  213. ["ParentMaterialClassId", "=", clickRow.data.ParentFacilityClassId()]
  214. ]);
  215. FmsMaterialCodeClassDataSource.load().done(function (result) {
  216. FmsMaterialCodeClassInfo(result);
  217. });
  218. }
  219. RowName = clickRow.data.Name;
  220. }
  221. function handleViewDisposing() {
  222. BemsWebApplication.db[dbModelId].modified.remove(handleModification);
  223. }
  224. viewModel = BWA.CommonView.create(params, viewInfo, null, null, handleViewShown);
  225. hasnotModificationPermission = viewModel.hasnotModificationPermission;
  226. var dataSourceOptions = {
  227. store: BemsWebApplication.db[dbModelId],
  228. map: function (item) {
  229. return new BemsWebApplication[viewModelName](item);
  230. }
  231. };
  232. for (var k = 0 ; k < 3 ; k++) {
  233. dataSources[k] = new DevExpress.data.DataSource(dataSourceOptions);
  234. dataSources[k].pageSize(30);
  235. }
  236. dataSources[0].filter([
  237. ['SiteId', '=', BWA.UserInfo.SiteId()],
  238. 'and',
  239. [parentClassIdFieldName, '=', null]
  240. ]);
  241. dataSources[1].filter(parentClassIdFieldName, '=', -1);
  242. dataSources[2].filter(parentClassIdFieldName, '=', -1);
  243. function refreshList() {
  244. if (selectedClassDepth === 0) {
  245. refreshDataSource(0, null);
  246. }
  247. for (var i = Math.max(1, selectedClassDepth) ; i < 3 ; i++) {
  248. var classId = selectedIds[i - 1][classIdFieldName];
  249. if (_.isUndefined(classId)) continue;
  250. refreshDataSource(i, selectedIds[i - 1][classIdFieldName]);
  251. }
  252. }
  253. function handlePopupShowing(e) {
  254. if (isNewInPopup() == false) {
  255. activePopupViewMode();
  256. BemsWebApplication.db[dbModelId].byKey(selectedIds[selectedClassDepth]).done(function (data) {
  257. dataViewModel.fromJS(data);
  258. });
  259. }
  260. else {
  261. //activePopupInsertMode();
  262. clearDataModelValue(dataViewModel);
  263. }
  264. visibleCancelButton(false);
  265. }
  266. function clearDataModelValue(v) {
  267. $.each(v, function (name, value) {
  268. if (name !== parentClassIdFieldName && name !== 'Depth') {
  269. v[name](null);
  270. }
  271. });
  272. v.SiteId(BWA.UserInfo.SiteId());
  273. v.IsUse(true); // hcLee 2016 03 10
  274. }
  275. BemsWebApplication.db[dbModelId].modified.add(handleModification);
  276. // TODO: 아래 breakpoint 에 대해 FmsBudgetCodeClass 의 분기가 필요 함
  277. function handleConfirmDelete() {
  278. //alert(classIdFieldName);
  279. //alert(classIdFieldName.FacilityClassId);
  280. if (dbModelId == 'FmsBudgetCodeClass') {
  281. BWA.api.post('FmsBudgetCodeClass2/Delete', dataViewModel.toJS()).done(function () {
  282. refreshList();
  283. utils.toast.show($G('successDatabaseDeleteMsg'));
  284. popupVisible(false);
  285. });
  286. }
  287. else {
  288. var parameters = {
  289. SiteId: dataViewModel.SiteId(),
  290. Depth: dataViewModel.Depth()
  291. };
  292. parameters[classIdFieldName] = dataViewModel[classIdFieldName]();
  293. // alert(classIdFieldName + parameters[classIdFieldName]);
  294. BemsWebApplication.api.delete(dbModelId, parameters).done(function () {
  295. refreshList();
  296. utils.toast.show($G('successDatabaseDeleteMsg'));
  297. popupVisible(false);
  298. });
  299. }
  300. }
  301. function update() {
  302. if (dbModelId == 'FmsBudgetCodeClass') {
  303. BWA.api.post('FmsBudgetCodeClass2/Update', dataViewModel.toJS()).done(function () {
  304. refreshList();
  305. utils.toast.show($G('successDatabaseUpdateMsg'));
  306. popupVisible(false);
  307. });
  308. }
  309. else
  310. if (dbModelId == 'FmsFacilityCodeClass') {
  311. BWA.api.post('FmsFacilityCodeClass/Update', dataViewModel.toJS()).done(function () {
  312. refreshList();
  313. utils.toast.show($G('successDatabaseUpdateMsg'));
  314. popupVisible(false);
  315. });
  316. }
  317. else {
  318. BemsWebApplication.db[dbModelId].update(selectedIds[selectedClassDepth], dataViewModel.toJS()).done(function () {
  319. refreshList();
  320. utils.toast.show($G('successDatabaseUpdateMsg'));
  321. popupVisible(false);
  322. });
  323. }
  324. }
  325. function insert() {
  326. if (dbModelId == 'FmsBudgetCodeClass') {
  327. BWA.api.post('FmsBudgetCodeClass2/Insert', dataViewModel.toJS()).done(function () {
  328. refreshList();
  329. refreshAllStatus();
  330. utils.toast.show($G('successDatabaseInsertionMsg'));
  331. popupVisible(false);
  332. });
  333. }
  334. else {
  335. //if (dbModelId == 'FmsFacilityCodeClass') {
  336. // BWA.api.post('FmsFacilityCodeClass/Insert', dataViewModel.toJS()).done(function () {
  337. // refreshList();
  338. // refreshAllStatus();
  339. // utils.toast.show($G('successDatabaseInsertionMsg'));
  340. // popupVisible(false);
  341. // });
  342. //}
  343. //else {
  344. BemsWebApplication.db[dbModelId].insert(dataViewModel.toJS()).done(function (values, newId) {
  345. refreshList();
  346. refreshAllStatus();
  347. utils.toast.show($G('successDatabaseInsertionMsg'));
  348. popupVisible(false);
  349. });
  350. //}
  351. }
  352. }
  353. function activePopupEditMode() {
  354. viewModeInPopup(false);
  355. isEditModeInPopup(true);
  356. }
  357. function activePopupViewMode() {
  358. viewModeInPopup(true);
  359. isEditModeInPopup(false);
  360. }
  361. var tmpName, tmpAbbreviation;
  362. function handlePopupButtonEdit() {
  363. tmpName = dataViewModel.Name();
  364. tmpAbbreviation = dataViewModel.Abbreviation();
  365. activePopupEditMode();
  366. visibleCancelButton(true);
  367. }
  368. function handlePopupButtonCancel() {
  369. dataViewModel.Name(tmpName);
  370. dataViewModel.Abbreviation(tmpAbbreviation);
  371. activePopupViewMode();
  372. visibleCancelButton(false);
  373. }
  374. function popupInsertView() {
  375. activePopupEditMode();
  376. popupVisible(true);
  377. }
  378. function handlePopupButtonSave() {
  379. // 필수 입력 조건 체크
  380. // cyim 2015.12.28 : 설정-시설관리-시설등록-시설분류목록에 추가되는 항목에 입력 조건 추가 (약어,분류 명칭)
  381. //if (dbModelId == 'FmsFacilityCodeClass') {
  382. // if (BWA.DataUtil.isValidInputValue(dataViewModel.Abbreviation()) == false || BWA.DataUtil.isValidInputValue(dataViewModel.Name()) == false) {
  383. // utils.toast.show($G('Error_FmsFacilityCodeClass_NotInputData'), 'error');
  384. // return;
  385. // }
  386. // // hcLee 2016 01 15
  387. // // cyim 2015.12.30 : 설정-시설관리-시설등록-시설분류목록에 중복 입력 체크
  388. // BWA.api.post('FmsFacilityCodeClass/Check', dataViewModel.toJS()).done(function (result) {
  389. // if (result == false) {
  390. // utils.toast.show($G('Error_SameInputData'), 'error');
  391. // return;
  392. // }
  393. // if (isNewInPopup())
  394. // insert();
  395. // else
  396. // update();
  397. // });
  398. //}
  399. var isDuplicated = false;
  400. if (dbModelId == 'FmsFacilityCodeClass') {
  401. if (isNewInPopup()) {
  402. for (var i = 0; i < FmsFacilityCodeClassInfo().length; i++) {
  403. if (dataViewModel.Name() == FmsFacilityCodeClassInfo()[i].Name() || dataViewModel.Abbreviation() == FmsFacilityCodeClassInfo()[i].Abbreviation()) {
  404. isDuplicated = true;
  405. break;
  406. }
  407. }
  408. }
  409. else {
  410. for (var i = 0; i < FmsFacilityCodeClassInfo().length; i++) {
  411. if (RowName() != FmsFacilityCodeClassInfo()[i].Name() && (dataViewModel.Name() == FmsFacilityCodeClassInfo()[i].Name() || dataViewModel.Abbreviation() == FmsFacilityCodeClassInfo()[i].Abbreviation())) {
  412. isDuplicated = true;
  413. break;
  414. }
  415. }
  416. }
  417. if (!BWA.DataUtil.isValidInputValue(dataViewModel.Name()) || !BWA.DataUtil.isValidInputValue(dataViewModel.Abbreviation())) {
  418. utils.toast.show('저장 혹은 수정 반드시 필수 입력 정보를 모두 입력하셔야 합니다 (앞뒤공백 허용안함)', 'error');
  419. }
  420. else {
  421. if (isDuplicated) {
  422. utils.toast.show('이미 동일 정보가 존재합니다.', 'error');
  423. }
  424. else {
  425. if (isNewInPopup())
  426. insert();
  427. else
  428. update();
  429. }
  430. }
  431. }
  432. else if (dbModelId == 'FmsMaterialCodeClass') {
  433. if (isNewInPopup()) {
  434. for (var i = 0; i < FmsMaterialCodeClassInfo().length; i++) {
  435. if (dataViewModel.Name() == FmsMaterialCodeClassInfo()[i].Name() || dataViewModel.Abbreviation() == FmsMaterialCodeClassInfo()[i].Abbreviation()) {
  436. isDuplicated = true;
  437. break;
  438. }
  439. }
  440. }
  441. else {
  442. for (var i = 0; i < FmsMaterialCodeClassInfo().length; i++) {
  443. if (RowName() != FmsMaterialCodeClassInfo()[i].Name() && (dataViewModel.Name() == FmsMaterialCodeClassInfo()[i].Name() || dataViewModel.Abbreviation() == FmsMaterialCodeClassInfo()[i].Abbreviation())) {
  444. isDuplicated = true;
  445. break;
  446. }
  447. }
  448. }
  449. if (!BWA.DataUtil.isValidInputValue(dataViewModel.Name()) || !BWA.DataUtil.isValidInputValue(dataViewModel.Abbreviation())) {
  450. utils.toast.show('저장 혹은 수정 반드시 필수 입력 정보를 모두 입력하셔야 합니다 (앞뒤공백 허용안함)', 'error');
  451. }
  452. else {
  453. if (isDuplicated) {
  454. utils.toast.show('이미 동일 정보가 존재합니다.', 'error');
  455. }
  456. else {
  457. if (isNewInPopup())
  458. insert();
  459. else
  460. update();
  461. }
  462. }
  463. }
  464. else {
  465. // hcLee 2016 01 15
  466. if (isNewInPopup())
  467. insert();
  468. else
  469. update();
  470. }
  471. }
  472. function handlePopupButtonDelete() {
  473. DevExpress.ui.dialog.confirm($G('deleteConfirmMsg'), "삭제").then(function (result) {
  474. if (result) {
  475. handleConfirmDelete();
  476. }
  477. else {
  478. // toast
  479. }
  480. });
  481. }
  482. function handlePopupButtonClose() {
  483. popupVisible(false);
  484. }
  485. function setInsertPopupInfo(depth, parentClassId) {
  486. if (dbModelId == 'FmsFacilityCodeClass') {
  487. FmsFacilityCodeClassDataSource.filter([
  488. ["SiteId", "=", BWA.UserInfo.SiteId()],
  489. "and",
  490. ["Depth", "=", depth],
  491. "and",
  492. ["ParentFacilityClassId", "=", parentClassId]
  493. ]);
  494. FmsFacilityCodeClassDataSource.load().done(function (result) {
  495. FmsFacilityCodeClassInfo(result);
  496. });
  497. }
  498. else if (dbModelId == 'FmsMaterialCodeClass') {
  499. FmsMaterialCodeClassDataSource.filter([
  500. ["SiteId", "=", BWA.UserInfo.SiteId()],
  501. "and",
  502. ["Depth", "=", depth],
  503. "and",
  504. ["ParentMaterialClassId", "=", parentClassId]
  505. ]);
  506. FmsMaterialCodeClassDataSource.load().done(function (result) {
  507. FmsMaterialCodeClassInfo(result);
  508. });
  509. }
  510. isNewInPopup(true);
  511. activePopupEditMode();
  512. dataViewModel[parentClassIdFieldName](parentClassId);
  513. dataViewModel.Depth(depth);
  514. selectedClassDepth = depth;
  515. isClass3(depth === 2);
  516. popupVisible(true);
  517. }
  518. var toolbarItems = [
  519. { location: 'before', text: $G('detailInfo') },
  520. { location: 'after', widget: 'button', options: { text: $G('edit'), icon: 'edit', visible: viewModeInPopup, clickAction: handlePopupButtonEdit } },
  521. { location: 'after', widget: 'button', options: { text: $G('delete'), type: 'danger', icon: 'remove', visible: viewModeInPopup, clickAction: handlePopupButtonDelete } },
  522. { location: 'after', widget: 'button', options: { text: $G('cancel'), icon: 'arrowleft', type: 'default', visible: visibleCancelButton, clickAction: handlePopupButtonCancel } },
  523. { location: 'after', widget: 'button', options: { text: $G('save'), icon: 'save', visible: isEditModeInPopup, clickAction: handlePopupButtonSave } },
  524. { location: 'after', widget: 'button', options: { text: $G('close'), icon: 'close', clickAction: handlePopupButtonClose } }
  525. ];
  526. var popupOptions = {
  527. width: '480px',
  528. height: 'auto',
  529. visible: popupVisible,
  530. closeOnOutsideClick: true,
  531. showingAction: handlePopupShowing,
  532. animation: {
  533. show: { type: "pop", duration: 200, from: { opacity: 1, scale: 0.4 }, to: { scale: 1 } },
  534. hide: { type: "fade", duration: 200, from: 1, to: 0 }
  535. }
  536. };
  537. return $.extend(viewModel, {
  538. dataModel: dataViewModel,
  539. refreshList: refreshList,
  540. //viewShowing: handleViewShowing ,
  541. //viewShown: handleViewShown,
  542. viewDisposing: handleViewDisposing,
  543. popupInsertView: popupInsertView,
  544. viewModeInPopup: viewModeInPopup,
  545. isEditModeInPopup: isEditModeInPopup,
  546. isNewInPopup: isNewInPopup,
  547. popupOptions: popupOptions,
  548. commandInsertButtonOptions: commandInsertButtonOptions,
  549. commandUpdateButtonOption: commandUpdateButtonOption,
  550. selectedClassName: selectedClassName,
  551. toolbarItems: toolbarItems,
  552. isClass3: isClass3,
  553. });
  554. };
  555. })();