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