Stat.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. MWF.xApplication = MWF.xApplication || {};
  2. MWF.xApplication.query = MWF.xApplication.query || {};
  3. MWF.xApplication.query.StatDesigner = MWF.xApplication.query.StatDesigner || {};
  4. MWF.APPDSTD = MWF.xApplication.query.StatDesigner;
  5. MWF.xDesktop.requireApp("query.StatDesigner", "lp."+MWF.language, null, false);
  6. MWF.xDesktop.requireApp("query.ViewDesigner", "View", null, false);
  7. MWF.xDesktop.requireApp("query.StatDesigner", "Property", null, false);
  8. MWF.xApplication.query.StatDesigner.Stat = new Class({
  9. Extends: MWF.xApplication.query.ViewDesigner.View,
  10. Implements: [Options, Events],
  11. options: {
  12. "style": "default",
  13. "isView": false,
  14. "showTab": true,
  15. "propertyPath": "/x_component_query_StatDesigner/$Stat/stat.html"
  16. },
  17. initialize: function(designer, data, options){
  18. this.setOptions(options);
  19. this.path = "/x_component_query_StatDesigner/$Stat/";
  20. this.cssPath = "/x_component_query_StatDesigner/$Stat/"+this.options.style+"/css.wcss";
  21. this._loadCss();
  22. this.designer = designer;
  23. this.data = data;
  24. if (!this.data.data) this.data.data = {};
  25. this.parseData();
  26. this.node = this.designer.designNode;
  27. this.areaNode = new Element("div", {"styles": {"height": "100%", "overflow": "auto"}});
  28. this.propertyListNode = this.designer.propertyDomArea;
  29. if(this.designer.application) this.data.applicationName = this.designer.application.name;
  30. if(this.designer.application) this.data.application = this.designer.application.id;
  31. this.isNewView = (this.data.id) ? false : true;
  32. this.items = [];
  33. this.view = this;
  34. this.queryView = null;
  35. this.autoSave();
  36. this.designer.addEvent("queryClose", function(){
  37. if (this.autoSaveTimerID) window.clearInterval(this.autoSaveTimerID);
  38. }.bind(this));
  39. },
  40. changeViewSelected: function(){
  41. if (this.json.view){
  42. if (!this.queryView){
  43. this.designer.actions.getView(this.json.view, function(view){
  44. this.queryView = JSON.decode(view.data.data);
  45. this.items.each(function(item){
  46. item.changeViewSelected(this.queryView);
  47. }.bind(this));
  48. this.checkIsGroupRadioDisplay();
  49. }.bind(this));
  50. }else{
  51. this.items.each(function(item){
  52. item.changeViewSelected(this.queryView);
  53. }.bind(this));
  54. this.checkIsGroupRadioDisplay();
  55. }
  56. }else{
  57. //item.changeViewSelected();
  58. }
  59. },
  60. checkIsGroupRadioDisplay: function(){
  61. debugger;
  62. if (this.property){
  63. var groupNode = this.property.propertyContent.getElement(".MWFIsGroupArea");
  64. if (groupNode){
  65. if (this.queryView.group.column){
  66. groupNode.setStyle("display", "block");
  67. }else{
  68. this.json.data.calculate.isGroup = false;
  69. var radios = groupNode.getElements("input");
  70. for (var i=0; i<radios.length; i++){
  71. if (radios[i].value=="false"){
  72. radios[i].set("checked", true);
  73. break;
  74. }
  75. }
  76. this.hideGroupTitle();
  77. groupNode.setStyle("display", "none");
  78. }
  79. }
  80. }
  81. },
  82. checkIsGroupRadio: function(){
  83. if (!this.queryView){
  84. this.designer.actions.getView(this.json.view, function(view){
  85. this.queryView = JSON.decode(view.data.data);
  86. this.checkIsGroupRadioDisplay();
  87. }.bind(this));
  88. }else{
  89. this.checkIsGroupRadioDisplay();
  90. }
  91. },
  92. showProperty: function(){
  93. debugger;
  94. if (!this.property){
  95. this.property = new MWF.xApplication.query.StatDesigner.Property(this, this.designer.propertyContentArea, this.designer, {
  96. "path": this.options.propertyPath,
  97. "onPostLoad": function(){
  98. this.property.show();
  99. }.bind(this)
  100. });
  101. this.property.load();
  102. }else{
  103. this.property.show();
  104. }
  105. },
  106. //getDataTr: function(ri){
  107. // var tr = null;
  108. // var trs = this.viewContentTableNode.getElements("tr");
  109. // if (trs.length) if (trs[ri]) tr = trs[ri];
  110. // return tr;
  111. //},
  112. //getDataTd: function(tr, ci){
  113. // var td = null;
  114. // var tds = tr.getElements("td");
  115. // if (tds.length) if (tds[ci]) td = tds[ci];
  116. // return td;
  117. //},
  118. //getDataLastColumnCell: function(ri, ci){
  119. // var trs = this.viewContentTableNode.getElements("tr");
  120. // if (trs.length) if (trs[ri]) tr = trs[ri];
  121. // var td = null;
  122. // var tds = tr.getElements("td");
  123. // if (tds.length) if (tds[ci]) td = tds[ci];
  124. // return td;
  125. //},
  126. loadViewData: function(){
  127. debugger;
  128. if (this.data.id){
  129. this.saveSilence(function(){
  130. this.viewContentBodyNode.empty();
  131. this.viewContentTableNode = new Element("table", {
  132. "styles": this.css.viewContentTableNode,
  133. "border": "0px",
  134. "cellPadding": "0",
  135. "cellSpacing": "0"
  136. }).inject(this.viewContentBodyNode);
  137. this.designer.actions.loadStat(this.data.id, null, function(json){
  138. var entries = {};
  139. json.data.selectList.each(function(entry){entries[entry.column] = entry;}.bind(this));
  140. if (this.json.data.calculate.isGroup){
  141. if (json.data.calculateGrid.length){
  142. json.data.calculateGrid.each(function(d){
  143. var groupColumn = null;
  144. for (var c = 0; c<json.data.selectList.length; c++){
  145. if (json.data.selectList[c].column === json.data.group.column){
  146. groupColumn = json.data.selectList[c];
  147. break;
  148. }
  149. }
  150. var tr = new Element("tr", {"styles": this.css.viewContentTrNode}).inject(this.viewContentTableNode);
  151. var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(tr);
  152. if (groupColumn){
  153. td.set("text", (groupColumn.code) ? MWF.Macro.exec(groupColumn.code, {"value": d.group, "data": json.data}) : d.group);
  154. }else{
  155. td.set("text", d.group);
  156. }
  157. //td.set("text", d.group);
  158. td.setStyle("font-weight", "bold");
  159. d.list.each(function(c){
  160. var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(tr);
  161. td.set("text", (entries[c.column].code) ? MWF.Macro.exec(entries[c.column].code, {"value": c.value, "data": json.data}) : c.value);
  162. }.bind(this));
  163. }.bind(this));
  164. }
  165. if (json.data.calculateAmountGrid){
  166. var tr = new Element("tr", {"styles": this.css.viewContentTrNode}).inject(this.viewContentTableNode);
  167. var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(tr);
  168. td.set("text", this.designer.lp.amount);
  169. td.setStyles({"font-weight": "bold", "color": "#0000FF"});
  170. json.data.calculateAmountGrid.each(function(c){
  171. var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(tr);
  172. td.set("text", c.value);
  173. td.setStyles({"font-weight": "bold", "color": "#0000FF"});
  174. }.bind(this));
  175. }
  176. }else{
  177. if (json.data.calculateGrid.length){
  178. var tr = new Element("tr", {"styles": this.css.viewContentTrNode}).inject(this.viewContentTableNode);
  179. json.data.calculateGrid.each(function(d){
  180. var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(tr);
  181. td.set("text", d.value);
  182. }.bind(this));
  183. }
  184. }
  185. this.setContentColumnWidth();
  186. this.setContentHeight();
  187. }.bind(this));
  188. }.bind(this));
  189. }
  190. },
  191. addColumn: function(){
  192. debugger;
  193. MWF.require("MWF.widget.UUID", function(){
  194. var id = (new MWF.widget.UUID).id;
  195. var json = {
  196. "id": id,
  197. "column": "",
  198. "displayName": this.designer.lp.unnamed,
  199. "calculateType": "sum",
  200. "orderType": "original",
  201. "orderEffectType": "key"
  202. };
  203. if (!this.json.data.calculate.calculateList) this.json.data.calculate.calculateList = [];
  204. this.json.data.calculate.calculateList.push(json);
  205. var column = new MWF.xApplication.query.StatDesigner.Stat.Column(json, this);
  206. this.items.push(column);
  207. column.selected();
  208. if (this.property) this.property.loadStatColumnSelect();
  209. if (this.viewContentTableNode){
  210. var trs = this.viewContentTableNode.getElements("tr");
  211. trs.each(function(tr){
  212. new Element("td", {"styles": this.css.viewContentTdNode}).inject(tr)
  213. }.bind(this));
  214. //this.setContentColumnWidth();
  215. }
  216. this.setViewWidth();
  217. this.addColumnNode.scrollIntoView(true);
  218. }.bind(this));
  219. //new Fx.Scroll(this.view.areaNode, {"wheelStops": false, "duration": 0}).toRight();
  220. },
  221. loadViewColumns: function(){
  222. // for (var i=0; i<10; i++){
  223. if (this.json.data.calculate.calculateList) {
  224. this.json.data.calculate.calculateList.each(function (json) {
  225. this.items.push(new MWF.xApplication.query.StatDesigner.Stat.Column(json, this));
  226. }.bind(this));
  227. }
  228. // }
  229. },
  230. saveSilence: function(callback){
  231. if (!this.data.name){
  232. this.designer.notice(this.designer.lp.notice.inputName, "error");
  233. return false;
  234. }
  235. // if (!this.data.view){
  236. // this.designer.notice(this.designer.lp.notice.inputView, "error");
  237. // return false;
  238. // }
  239. if (!this.checkViewAndColumn()){
  240. this.designer.notice(this.designer.lp.notice.errorViewColumn, "error");
  241. return false;
  242. }
  243. this.designer.actions.saveStat(this.data, function(json){
  244. this.data.id = json.data.id;
  245. if (this.lisNode) {
  246. this.lisNode.getLast().set("text", this.data.name+"("+this.data.alias+")");
  247. }
  248. if (callback) callback();
  249. }.bind(this));
  250. },
  251. save: function(callback){
  252. //if (this.designer.tab.showPage==this.page){
  253. debugger;
  254. if (!this.data.name){
  255. this.designer.notice(this.designer.lp.notice.inputName, "error");
  256. return false;
  257. }
  258. // if (!this.data.view){
  259. // this.designer.notice(this.designer.lp.notice.inputView, "error");
  260. // return false;
  261. // }
  262. if (!this.checkViewAndColumn()){
  263. this.designer.notice(this.designer.lp.notice.errorViewColumn, "error");
  264. return false;
  265. }
  266. //}
  267. this.designer.actions.saveStat(this.data, function(json){
  268. this.designer.notice(this.designer.lp.notice.save_success, "success", this.node, {"x": "left", "y": "bottom"});
  269. this.data.id = json.data.id;
  270. if (this.lisNode) {
  271. this.lisNode.getLast().set("text", this.data.name+"("+this.data.alias+")");
  272. }
  273. if (callback) callback();
  274. }.bind(this));
  275. },
  276. checkViewAndColumn: function(){
  277. // if (this.json.view){
  278. var flag = true;
  279. for (var i = 0; i<this.items.length; i++){
  280. if (!this.items[i].checkColumn()) flag = false;
  281. }
  282. return flag;
  283. // }else{
  284. // return false;
  285. // }
  286. },
  287. _setEditStyle: function(name, input, oldValue){
  288. debugger;
  289. // if (name=="view"){
  290. // if (this.data.view!=oldValue){
  291. // this.viewContentBodyNode.empty();
  292. // this.designer.actions.getView(this.json.view, function(view){
  293. // this.queryView = JSON.decode(view.data.data);
  294. // }.bind(this), null, false);
  295. //
  296. // this.changeViewSelected();
  297. // this.checkViewAndColumn();
  298. // }
  299. // }
  300. if (name=="data.calculate.isGroup"){
  301. this.viewContentBodyNode.empty();
  302. if (this.data.data.calculate.isGroup){
  303. this.showGroupTitle();
  304. }else{
  305. this.hideGroupTitle();
  306. }
  307. }
  308. if (name=="data.calculate.title"){
  309. if (!this.data.data.calculate.title){
  310. this.data.data.calculate.title = this.designer.lp.category;
  311. }
  312. if (this.data.data.calculate.title!= oldValue){
  313. if (this.groupTitleNode){
  314. this.groupTitleNode.getFirst().getFirst().set("text", this.data.data.calculate.title);
  315. }
  316. }
  317. }
  318. },
  319. showGroupTitle: function(){
  320. if (!this.groupTitleNode) this.createGroupTitltNode();
  321. },
  322. hideGroupTitle: function(){
  323. if (this.groupTitleNode){
  324. this.groupTitleNode.destroy();
  325. this.groupTitleNode = null;
  326. }
  327. },
  328. createGroupTitltNode: function(){
  329. this.data.data.calculate.title = this.data.data.calculate.title || this.designer.lp.category;
  330. this.groupTitleNode = new Element("td", {"styles": this.css.viewGroupTitleNode});
  331. var node = new Element("div", {
  332. "styles": this.css.viewGroupTitleColumnNode
  333. }).inject(this.groupTitleNode);
  334. var textNode = new Element("div", {
  335. "styles": this.css.viewGroupTitleColumnTextNode,
  336. "text": this.data.data.calculate.title
  337. }).inject(node);
  338. if (this.items.length){
  339. this.groupTitleNode.inject(this.items[0].areaNode, "before");
  340. }else{
  341. this.groupTitleNode.inject(this.viewTitleTrNode);
  342. }
  343. },
  344. saveAs: function(){
  345. debugger;
  346. var form = new MWF.xApplication.query.StatDesigner.Stat.NewNameForm(this, {
  347. name : this.data.name + "_" + MWF.xApplication.query.StatDesigner.LP.copy,
  348. view : this.data.view,
  349. query : this.data.query || this.data.application,
  350. queryName : this.data.queryName || this.data.applicationName
  351. }, {
  352. onSave : function( data, callback ){
  353. this._saveAs( data, callback );
  354. }.bind(this)
  355. }, {
  356. app: this.designer
  357. });
  358. form.edit()
  359. },
  360. explode: function(){},
  361. implode: function(){},
  362. _saveAs : function( data , callback){
  363. var _self = this;
  364. var d = Object.clone( this.data );
  365. d.isNewView = true;
  366. d.id = this.designer.actions.getUUID();
  367. d.name = data.name;
  368. d.alias = "";
  369. d.query = data.query;
  370. d.queryName = data.queryName;
  371. d.application = data.query;
  372. d.applicationName = data.queryName;
  373. d.view = data.view;
  374. //d.pid = d.id + d.id;
  375. //delete d[this.data.id+"viewFilterType"];
  376. //d[d.id+"viewFilterType"]="custom";
  377. if( d.data.calculate && d.data.calculate.calculateList ){
  378. d.data.calculate.calculateList.each( function( entry ){
  379. entry.id = (new MWF.widget.UUID).id;
  380. }.bind(this));
  381. }
  382. this.designer.actions.saveStat(d, function(json){
  383. this.designer.notice(this.designer.lp.notice.saveAs_success, "success", this.node, {"x": "left", "y": "bottom"});
  384. if (callback) callback();
  385. }.bind(this));
  386. }
  387. //_setEditStyle: function(){}
  388. });
  389. MWF.xApplication.query.StatDesigner.Stat.Column = new Class({
  390. Extends:MWF.xApplication.query.ViewDesigner.View.Column,
  391. initialize: function(json, view, next){
  392. this.propertyPath = "/x_component_query_StatDesigner/$Stat/column.html";
  393. this.view = view;
  394. this.json = json;
  395. this.next = next;
  396. this.css = this.view.css;
  397. this.content = this.view.viewTitleTrNode;
  398. this.domListNode = this.view.domListNode;
  399. this.load();
  400. },
  401. showProperty: function(){
  402. if (!this.property){
  403. this.property = new MWF.xApplication.query.StatDesigner.Property(this, this.view.designer.propertyContentArea, this.view.designer, {
  404. "path": this.propertyPath,
  405. "onPostLoad": function(){
  406. this.property.show();
  407. }.bind(this)
  408. });
  409. this.property.load();
  410. }else{
  411. this.property.show();
  412. }
  413. },
  414. _setEditStyle: function(name, input, oldValue){
  415. debugger;
  416. //if (name=="displayName") this.resetTextNode();
  417. //if (name=="selectType") this.resetTextNode();
  418. //if (name=="attribute") this.resetTextNode();
  419. //if (name=="path") this.resetTextNode();
  420. if (name=="displayName") this.resetTextNode();
  421. if (name=="column") this.checkColumn();
  422. if (name=="view"){
  423. if (this.json.view!=oldValue){
  424. this.view.viewContentBodyNode.empty();
  425. this.view.designer.actions.getView(this.json.view, function(view){
  426. this.queryView = JSON.decode(view.data.data);
  427. }.bind(this), null, false);
  428. this.changeViewSelected();
  429. //this.checkViewAndColumn();
  430. }
  431. }
  432. },
  433. resetTextNode: function(){
  434. var listText = this.json.displayName+"("+this.json.calculateType+")";
  435. this.textNode.set("text", this.json.displayName);
  436. this.listNode.getLast().set("text", listText);
  437. if (this.view.property) this.view.property.loadStatColumnSelect();
  438. },
  439. "delete": function(e){
  440. var _self = this;
  441. if (!e) e = this.node;
  442. this.view.designer.confirm("warn", e, MWF.APPDSTD.LP.notice.deleteColumnTitle, MWF.APPDSTD.LP.notice.deleteColumn, 300, 120, function(){
  443. _self.destroy();
  444. this.close();
  445. }, function(){
  446. this.close();
  447. }, null);
  448. },
  449. addColumn: function(e, data){
  450. MWF.require("MWF.widget.UUID", function(){
  451. var json;
  452. if (data){
  453. json = Object.clone(data);
  454. json.id = (new MWF.widget.UUID).id;
  455. json.column = (new MWF.widget.UUID).id;
  456. }else{
  457. var id = (new MWF.widget.UUID).id;
  458. json = {
  459. "id": id,
  460. "column": "",
  461. "displayName": this.view.designer.lp.unnamed,
  462. "calculateType": "sum",
  463. "orderType": "original",
  464. "orderEffectType": "key"
  465. };
  466. }
  467. var idx = this.view.json.data.calculate.calculateList.indexOf(this.json);
  468. this.view.json.data.calculate.calculateList.splice(idx, 0, json);
  469. var column = new MWF.xApplication.query.StatDesigner.Stat.Column(json, this.view, this);
  470. this.view.items.splice(idx, 0, column);
  471. column.selected();
  472. if (this.view.property) this.view.property.loadStatColumnSelect();
  473. if (this.view.viewContentTableNode){
  474. var trs = this.view.viewContentTableNode.getElements("tr");
  475. trs.each(function(tr){
  476. var td = tr.insertCell(idx);
  477. td.setStyles(this.css.viewContentTdNode);
  478. }.bind(this));
  479. }
  480. this.view.setViewWidth();
  481. }.bind(this));
  482. },
  483. _setNodeMove: function(droppables, e){
  484. this._setMoveNodePosition(e);
  485. var movePosition = this.moveNode.getPosition();
  486. var moveSize = this.moveNode.getSize();
  487. var contentPosition = this.content.getPosition();
  488. var contentSize = this.content.getSize();
  489. var nodeDrag = new Drag.Move(this.moveNode, {
  490. "droppables": droppables,
  491. "limit": {
  492. "x": [contentPosition.x, contentPosition.x+contentSize.x],
  493. "y": [movePosition.y, movePosition.y+moveSize.y]
  494. },
  495. "onEnter": function(dragging, inObj){
  496. if (!this.moveFlagNode) this.createMoveFlagNode();
  497. this.moveFlagNode.inject(inObj, "before");
  498. }.bind(this),
  499. "onLeave": function(dragging, inObj){
  500. if (this.moveFlagNode){
  501. this.moveFlagNode.dispose();
  502. }
  503. }.bind(this),
  504. "onDrop": function(dragging, inObj){
  505. if (inObj){
  506. this.areaNode.inject(inObj, "before");
  507. var column = inObj.retrieve("column");
  508. this.listNode.inject(column.listNode, "before");
  509. var idx = this.view.json.data.calculate.calculateList.indexOf(column.json);
  510. this.view.json.data.calculate.calculateList.erase(this.json);
  511. this.view.items.erase(this);
  512. this.view.json.data.calculate.calculateList.splice(idx, 0, this.json);
  513. this.view.items.splice(idx, 0, this);
  514. if (this.moveNode) this.moveNode.destroy();
  515. if (this.moveFlagNode) this.moveFlagNode.destroy();
  516. this._setActionAreaPosition();
  517. }else{
  518. if (this.moveNode) this.moveNode.destroy();
  519. if (this.moveFlagNode) this.moveFlagNode.destroy();
  520. }
  521. }.bind(this),
  522. "onCancel": function(dragging){
  523. if (this.moveNode) this.moveNode.destroy();
  524. if (this.moveFlagNode) this.moveFlagNode.destroy();
  525. }.bind(this)
  526. });
  527. nodeDrag.start(e);
  528. },
  529. changeViewSelected: function(json){
  530. debugger;
  531. if (json){
  532. this.changeViewColumnOptions(json);
  533. }else{
  534. if (this.json.view){
  535. if (!this.queryView){
  536. this.view.designer.actions.getView(this.json.view, function(view){
  537. this.queryView = JSON.decode(view.data.data);
  538. this.changeViewColumnOptions(this.queryView);
  539. }.bind(this));
  540. }else{
  541. this.changeViewColumnOptions(this.queryView);
  542. }
  543. }else{
  544. this.changeViewColumnOptions(json);
  545. }
  546. }
  547. },
  548. changeViewColumnOptions: function(json){
  549. if (this.property){
  550. var nodes = this.property.propertyContent.getElements(".MWFViewColumnSelect");
  551. nodes.each(function(node){
  552. node.empty();
  553. if (json){
  554. new Element("option", {
  555. "value": "",
  556. "text": "(none)",
  557. "selected": (!this.json.column)
  558. }).inject(node);
  559. json.selectList.each(function(col){
  560. var o = new Element("option", {
  561. "value": col.column,
  562. "text": col.displayName,
  563. "selected": (col.column==this.json.column)
  564. }).inject(node);
  565. }.bind(this));
  566. }else{
  567. this.json.column = "";
  568. }
  569. }.bind(this));
  570. }
  571. },
  572. checkColumn: function(){
  573. var flag = true;
  574. if (!this.queryView){
  575. if (this.json.view){
  576. this.view.designer.actions.getView(this.json.view, function(view){
  577. this.queryView = JSON.decode(view.data.data);
  578. }.bind(this), null, false);
  579. }else{
  580. this.errorMark();
  581. return false;
  582. }
  583. }
  584. var col = this.queryView.selectList.filter(function(c){
  585. return (c.column==this.json.column);
  586. }.bind(this));
  587. if (!col.length){
  588. this.errorMark();
  589. flag = false;
  590. }else{
  591. this.errorMark(true);
  592. }
  593. return flag;
  594. },
  595. errorMark: function(flag){
  596. if (flag){
  597. this.isError = false;
  598. if (!this.isSelected) this.node.setStyles(this.css.viewTitleColumnNode);
  599. }else{
  600. this.isError = true;
  601. if (!this.isSelected) this.node.setStyles(this.css.viewTitleColumnNode_error);
  602. }
  603. }
  604. });