Table.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
  2. MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Component", null, false);
  3. MWF.xDesktop.requireApp("process.FormDesigner", "Module.Table$Td", null, false);
  4. MWF.xApplication.process.FormDesigner.Module.Table = MWF.FCTable = new Class({
  5. Extends: MWF.FC$Component,
  6. Implements: [Options, Events],
  7. options: {
  8. "style": "default",
  9. "propertyPath": "../x_component_process_FormDesigner/Module/Table/table.html",
  10. "propertyMultiPath": "../x_component_process_FormDesigner/Module/Table$Td/table$tdMulti.html",
  11. "multiActions": [
  12. {
  13. "name": "mergerCell",
  14. "icon": "mergerCell.png",
  15. "event": "click",
  16. "action": "mergerCell",
  17. "title": MWF.APPFD.LP.formAction.mergerCell
  18. }
  19. ]
  20. },
  21. initialize: function(form, options){
  22. this.setOptions(options);
  23. this.path = "../x_component_process_FormDesigner/Module/Table/";
  24. this.cssPath = "../x_component_process_FormDesigner/Module/Table/"+this.options.style+"/css.wcss";
  25. this._loadCss();
  26. this.moduleType = "component";
  27. this.moduleName = "table";
  28. this.form = form;
  29. this.container = null;
  30. this.containerNode = null;
  31. this.containers = [];
  32. this.elements = [];
  33. this.selectedMultiTds = [];
  34. },
  35. clearTemplateStyles: function(styles){
  36. if (styles){
  37. if (styles.styles) this.removeStyles(styles.styles, "styles");
  38. if (styles.tableStyles) this.removeStyles(styles.tableStyles, "tableStyles");
  39. if (styles.properties) this.removeStyles(styles.properties, "properties");
  40. if (styles.titleStyles) this.removeStyles(styles.titleStyles, "titleTdStyles");
  41. if (styles.contentStyles) this.removeStyles(styles.contentStyles, "contentTdStyles");
  42. if (styles.layoutStyles) this.removeStyles(styles.layoutStyles, "layoutTdStyles");
  43. }
  44. },
  45. setTemplateStyles: function(styles){
  46. if (styles.styles) this.copyStyles(styles.styles, "styles");
  47. if (styles.tableStyles) this.copyStyles(styles.tableStyles, "tableStyles");
  48. if (styles.properties) this.copyStyles(styles.properties, "properties");
  49. if (styles.titleStyles) this.copyStyles(styles.titleStyles, "titleTdStyles");
  50. if (styles.contentStyles) this.copyStyles(styles.contentStyles, "contentTdStyles");
  51. if (styles.layoutStyles) this.copyStyles(styles.layoutStyles, "layoutTdStyles");
  52. },
  53. _createMoveNode: function(){
  54. var tableHTML = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"2\" width=\"100%\" align=\"center\">";
  55. tableHTML += "<tr><td></td><td></td><td></td></tr>";
  56. tableHTML += "<tr><td></td><td></td><td></td></tr>";
  57. tableHTML += "<tr><td></td><td></td><td></td></tr>";
  58. tableHTML += "</table>";
  59. this.moveNode = new Element("div", {
  60. "html": tableHTML
  61. }).inject(this.form.container);
  62. // this.moveNode = divNode.getFirst();
  63. // this.moveNode.inject(divNode, "after");
  64. // divNode.destroy();
  65. this.moveNode.setStyles(this.css.moduleNodeMove);
  66. this._setTableStyle();
  67. },
  68. _setTableStyle: function(){
  69. var tds = this.moveNode.getElements("td");
  70. //var tds = this._getTds(this.moveNode);
  71. tds.setStyles({
  72. "border": "1px dashed #999",
  73. "height": "20px"
  74. });
  75. var ths = this.moveNode.getElements("th");
  76. //var tds = this._getTds(this.moveNode);
  77. ths.setStyles({
  78. "border": "1px dashed #999",
  79. "height": "20px"
  80. });
  81. },
  82. _getTds: function(node){
  83. tds = [];
  84. var table = (node || this.node).getElement("table");
  85. var rows = table.rows;
  86. for (var i=0; i<rows.length; i++){
  87. var row = rows[i];
  88. for (var j=0; j<row.cells.length; j++){
  89. tds.push(row.cells[j]);
  90. }
  91. }
  92. return tds;
  93. },
  94. _checkSelectedTds: function(sp, ep){
  95. this.selectedMultiTds = [];
  96. //var tds = this.node.getElements("td");
  97. var tds = this._getTds();
  98. // var tmpSelectedTds = [];
  99. // var startXList = [];
  100. // var startYList = [];
  101. // var endXList = [];
  102. // var endYList = [];
  103. var sx = sp.x, sy = sp.y, ex = ep.x, ey = ep.y;
  104. while (true){
  105. var tmpsx = sp.x, tmpsy = sp.y, tmpex = ep.x, tmpey = ep.y;
  106. tds.each(function(td){
  107. if (td.isInPointInRect(sx, sy, ex, ey)){
  108. var position = td.getPosition();
  109. var size = td.getSize();
  110. if (!tmpsx || position.x<tmpsx) tmpsx = position.x;
  111. if (!tmpsy || position.y<tmpsy) tmpsy = position.y;
  112. if (!tmpex || position.x+size.x>tmpex) tmpex = position.x+size.x;
  113. if (!tmpey || position.y+size.y>tmpey) tmpey = position.y+size.y;
  114. }
  115. }.bind(this));
  116. if (sx==tmpsx && sy==tmpsy && ex==tmpex && ey==tmpey) break;
  117. sx = tmpsx, sy = tmpsy, ex = tmpex, ey = tmpey;
  118. }
  119. tds.each(function(td){
  120. var module = td.retrieve("module");
  121. if (td.isInPointInRect(sx, sy, ex, ey)){
  122. module.selectedMulti();
  123. }else{
  124. module.unSelectedMulti();
  125. }
  126. }.bind(this));
  127. },
  128. _setOtherNodeEvent: function(){
  129. this.dragInfor = {};
  130. var table = this.node.getElement("table");
  131. this.tdDragSelect = new Drag(this.node, {
  132. "stopPropagation": true,
  133. "preventDefault": true,
  134. "onStart": function(el, e){
  135. var cellspacing = table.get("cellspacing");
  136. if( !cellspacing || cellspacing.toInt() === 0 ){
  137. this.tmpCellspacing = cellspacing || "0";
  138. table.set("cellspacing", "1");
  139. }
  140. this.form._beginSelectMulti();
  141. var position = e.event.target.getPosition();
  142. this.dragInfor.start = {"x": e.event.offsetX+position.x, "y": e.event.offsetY+position.y};
  143. }.bind(this),
  144. "onDrag": function(el, e){
  145. var position = e.event.target.getPosition();
  146. var p = {"x": e.event.offsetX+position.x, "y": e.event.offsetY+position.y};
  147. this._checkSelectedTds(this.dragInfor.start, p);
  148. e.stopPropagation();
  149. }.bind(this),
  150. "onComplete": function(el, e){
  151. var position = e.event.target.getPosition();
  152. var p = {"x": e.event.offsetX+position.x, "y": e.event.offsetY+position.y};
  153. this._checkSelectedTds(this.dragInfor.start, p);
  154. this.form._completeSelectMulti();
  155. this._createMultiSelectedActions();
  156. this.showMultiProperty();
  157. if( this.hasOwnProperty("tmpCellspacing") ){
  158. table.set("cellspacing", this.tmpCellspacing );
  159. this.tmpCellspacing = null;
  160. }
  161. e.stopPropagation();
  162. e.preventDefault();
  163. }.bind(this)
  164. });
  165. },
  166. showMultiProperty: function(){
  167. if (this.form.propertyMultiTd){
  168. this.form.propertyMultiTd.hide();
  169. this.form.propertyMultiTd = null;
  170. }
  171. this.form.propertyMultiTd = new MWF.xApplication.process.FormDesigner.PropertyMulti(this.form, this.form.selectedModules, this.form.designer.propertyContentArea, this.form.designer, {
  172. "path": this.options.propertyMultiPath,
  173. "onPostLoad": function(){
  174. this.show();
  175. }
  176. });
  177. this.form.propertyMultiTd.load();
  178. },
  179. _createMultiSelectedActions: function(){
  180. if (this.form.selectedModules.length>1){
  181. if (this.form.multimoduleActionsArea){
  182. this.form.multimoduleActionsArea.empty();
  183. this.options.multiActions.each(function(action){
  184. var actionNode = new Element("div", {
  185. "styles": this.options.actionNodeStyles,
  186. "title": action.title
  187. }).inject(this.form.multimoduleActionsArea);
  188. actionNode.setStyle("background", "url("+this.path+this.options.style+"/icon/"+action.icon+") no-repeat left center");
  189. actionNode.addEvent(action.event, function(e){
  190. this[action.action](e);
  191. }.bind(this));
  192. }.bind(this));
  193. this.form.multimoduleActionsArea.setStyle("width", 18*this.options.multiActions.length);
  194. }
  195. }else if(this.form.multimoduleActionsArea){
  196. this.form.multimoduleActionsArea.setStyle("display", "none");
  197. }
  198. },
  199. mergerCell: function(){
  200. if (this.form.selectedModules.length>1){
  201. debugger;
  202. var fromLogList;
  203. if(this.form.history)fromLogList = this.createHistoryLogList(this.form.selectedModules);
  204. var firstModuleObj = this.form._getFirstMultiSelectedModule();
  205. var firstModule = firstModuleObj.module;
  206. // var n=0;
  207. var td = firstModule.node;
  208. var colspan = 0;
  209. while (td && this.form.selectedModules.indexOf(td.retrieve("module"))!=-1 ){
  210. var tmpColspan = td.get("colspan").toInt() || 1;
  211. colspan = colspan+tmpColspan;
  212. td = td.getNext("td");
  213. }
  214. var maxRowIndex = Number.NEGATIVE_INFINITY;
  215. var minRowIndex = Number.POSITIVE_INFINITY;
  216. this.form.selectedModules.each(function(module, idx){
  217. var rIdx = module.node.getParent("tr").rowIndex;
  218. var tmpRowspan = module.node.get("rowspan").toInt() || 1;
  219. var rows = rIdx+tmpRowspan-1;
  220. maxRowIndex = Math.max(maxRowIndex, rows);
  221. minRowIndex = Math.min(minRowIndex, rows);
  222. }.bind(this));
  223. var rowspan = maxRowIndex-minRowIndex+1;
  224. if (colspan>1){
  225. firstModule.node.set("colspan", colspan);
  226. firstModule.json.properties.colspan = colspan;
  227. }else{
  228. firstModule.node.set("colspan", 1);
  229. delete firstModule.node.colspan;
  230. delete firstModule.json.properties.colspan;
  231. }
  232. if (rowspan>1){
  233. firstModule.node.set("rowspan", rowspan);
  234. firstModule.json.properties.rowspan = rowspan;
  235. }else{
  236. firstModule.node.set("rowspan", 1);
  237. delete firstModule.node.rowspan;
  238. delete firstModule.json.properties.rowspan;
  239. }
  240. while (this.form.selectedModules.length){
  241. var module = this.form.selectedModules[0];
  242. this.form.selectedModules.erase(module);
  243. if (module!==firstModule){
  244. var modules = module._getSubModule();
  245. modules.each(function(module){
  246. module._moveTo(firstModule);
  247. });
  248. this.containers.erase(module);
  249. module.destroy();
  250. }
  251. }
  252. firstModule.selected();
  253. this.addHistoryLog("mergeCell", firstModule, fromLogList, firstModule.json.id, firstModule.json.type );
  254. }
  255. },
  256. _getContainers: function(){
  257. //var tds = this.node.getElements("td");
  258. var tds = this._getTds();
  259. this.form.getTemplateData("Table$Td", function(data){
  260. tds.each(function(td){
  261. var json = this.form.getDomjson(td);
  262. var tdContainer = null;
  263. if (!json){
  264. var moduleData = Object.clone(data);
  265. tdContainer = new MWF.FCTable$Td(this.form);
  266. tdContainer.table = this;
  267. tdContainer.load(moduleData, td, this);
  268. }else{
  269. var moduleData = Object.clone(data);
  270. Object.merge(moduleData, json);
  271. Object.merge(json, moduleData);
  272. tdContainer = new MWF.FCTable$Td(this.form);
  273. tdContainer.table = this;
  274. tdContainer.load(json, td, this);
  275. }
  276. this.containers.push(tdContainer);
  277. }.bind(this));
  278. }.bind(this));
  279. },
  280. _getElements: function(){
  281. // this.elements.push(this);
  282. var captions = this.node.getElements("caption");
  283. captions.each(function(caption){
  284. var json = this.form.getDomjson(caption);
  285. var el = null;
  286. if (!json){
  287. this.form.getTemplateData("Common", function(data){
  288. var moduleData = Object.clone(data);
  289. el = new MWF.FCCommon(this.form);
  290. el.table = this;
  291. el.load(moduleData, caption, this);
  292. }.bind(this));
  293. }else{
  294. el = new MWF.FCCommon(this.form);
  295. el.table = this;
  296. el.load(json, caption, this);
  297. }
  298. this.elements.push(el);
  299. }.bind(this));
  300. },
  301. _createNode: function(callback){
  302. var module = this;
  303. var url = this.path+"tableCreate.html";
  304. MWF.require("MWF.widget.Dialog", function(){
  305. var size = $(document.body).getSize();
  306. var x = size.x/2-180;
  307. var y = size.y/2-130;
  308. var dlg = new MWF.DL({
  309. "title": "Create Table",
  310. "style": "property",
  311. "top": y,
  312. "left": x-40,
  313. "fromTop":size.y/2-65,
  314. "fromLeft": size.x/2,
  315. "width": 360,
  316. "height": 260,
  317. "url": url,
  318. "lp": MWF.xApplication.process.FormDesigner.LP.propertyTemplate,
  319. "buttonList": [
  320. {
  321. "text": MWF.APPFD.LP.button.ok,
  322. "action": function(){
  323. module._createTableNode();
  324. callback();
  325. this.close();
  326. }
  327. }
  328. ]
  329. });
  330. dlg.show();
  331. }.bind(this));
  332. },
  333. _createTableNode: function(){
  334. var rows = $("MWFNewTableLine").get("value");
  335. var cols = $("MWFNewTableColumn").get("value");
  336. var width = $("MWFNewTableWidth").get("value");
  337. var widthUnitNode = $("MWFNewTableWidthUnit");
  338. var widthUnit = widthUnitNode.options[widthUnitNode.selectedIndex].value;
  339. var border = $("MWFNewTableBorder").get("value");
  340. var cellpadding = $("MWFNewTableCellpadding").get("value");
  341. var cellspacing = $("MWFNewTableCellspacing").get("value");
  342. var w = "";
  343. if (widthUnit=="percent"){
  344. w = width+"%";
  345. }else{
  346. w = width+"px";
  347. }
  348. this.json.properties.width = w;
  349. this.json.properties.border = border;
  350. this.json.properties.cellpadding = cellpadding;
  351. this.json.properties.cellspacing = cellspacing;
  352. var tableHTML = "<table border=\""+border+"\" cellpadding=\""+cellpadding+"\" cellspacing=\""+cellspacing+"\" width=\""+w+"\" align=\"center\">";
  353. for (var i=0; i<rows.toInt(); i++){
  354. tableHTML += "<tr>";
  355. for (var j=0; j<cols.toInt(); j++){
  356. tableHTML += "<td></td>";
  357. }
  358. tableHTML += "</tr>";
  359. }
  360. tableHTML += "</table>";
  361. this.node = this.node = new Element("div", {
  362. "id": this.json.id,
  363. "MWFType": "table",
  364. "html": tableHTML,
  365. "styles": this.css.moduleNode,
  366. "events": {
  367. "selectstart": function(e){
  368. e.preventDefault();
  369. }
  370. }
  371. }).inject(this.form.node);
  372. //if (w!="100%"){
  373. // this.node.setStyle("width", w);
  374. //}
  375. },
  376. _dragComplete: function(){
  377. if (!this.node){
  378. this._createNode(function(){
  379. this._dragMoveComplete();
  380. }.bind(this));
  381. }else{
  382. this._dragMoveComplete();
  383. }
  384. },
  385. _dragMoveComplete: function(){
  386. this._resetTreeNode();
  387. this.node.inject(this.copyNode, "before");
  388. this._initModule();
  389. var thisDisplay = this.node.retrieve("thisDisplay");
  390. if (thisDisplay){
  391. this.node.setStyle("display", thisDisplay);
  392. }
  393. if (this.copyNode) this.copyNode.destroy();
  394. if (this.moveNode) this.moveNode.destroy();
  395. this.moveNode = null;
  396. this.copyNode = null;
  397. this.nextModule = null;
  398. this.form.moveModule = null;
  399. this.form.json.moduleList[this.json.id] = this.json;
  400. this.selected();
  401. if( this.operation && !this.historyAddDelay ){
  402. this.addHistoryLog( this.operation, null, this.fromLog );
  403. }
  404. if( !this.historyAddDelay ){
  405. this.operation = null;
  406. this.fromLog = null;
  407. }
  408. },
  409. setPropertiesOrStyles: function(name){
  410. if (name=="styles"){
  411. try{
  412. this.setCustomStyles();
  413. }catch(e){}
  414. // var border = this.node.getStyle("border");
  415. // this.node.clearStyles();
  416. // this.node.setStyles(this.css.moduleNode);
  417. // this.node.setStyle("border", border);
  418. // Object.each(this.json.styles, function(value, key){
  419. // var reg = /^border\w*/ig;
  420. // if (!key.test(reg)){
  421. // this.node.setStyle(key, value);
  422. // }
  423. // }.bind(this));
  424. }else if(name=="tableStyles"){
  425. this.parseStyles( this.table, this.json.tableStyles );
  426. }
  427. if (name=="properties"){
  428. this.node.getFirst().setProperties(this.json.properties);
  429. if (this.json.properties.cellspacing==="0"){
  430. this.node.getFirst().setProperties({"cellspacing": "1"});
  431. }
  432. //if (this.json.properties.width){
  433. // if (this.json.properties.width!="100%"){
  434. // this.node.setStyle("width", this.json.properties.width);
  435. // }
  436. //}
  437. }
  438. },
  439. _setEditStyle_custom: function(name, obj, oldValue){
  440. if (name=="id"){
  441. if (oldValue && this.json.id!=oldValue){
  442. var reg = new RegExp("^"+oldValue, "i");
  443. this.containers.each(function(container){
  444. var id = container.json.id;
  445. var newId = id.replace(reg, this.json.id);
  446. container.json.id = newId;
  447. delete this.form.json.moduleList[id];
  448. this.form.json.moduleList[newId] = container.json;
  449. container._setEditStyle("id");
  450. }.bind(this));
  451. }
  452. }
  453. if (name=="titleTdStyles") this.setTabStyles();
  454. if (name=="contentTdStyles") this.setTabStyles();
  455. if (name=="layoutTdStyles") this.setTabStyles();
  456. },
  457. setTabStyles: function(){
  458. this.containers.each(function(module){
  459. //if (module.json.cellType=="title"){
  460. //
  461. //}
  462. //if (module.json.cellType=="content"){
  463. //
  464. //}
  465. //if (module.json.cellType=="layout"){
  466. //
  467. //}
  468. module.setCustomStyles();
  469. }.bind(this));
  470. },
  471. setAllStyles: function(){
  472. this.setPropertiesOrStyles("styles");
  473. this.setPropertiesOrStyles("tableStyles");
  474. this.setPropertiesOrStyles("properties");
  475. this.setTabStyles();
  476. this.reloadMaplist();
  477. },
  478. copyComponentJsonData: function(newNode, pid){
  479. //var tds = newNode.getElements("td");
  480. var tds = this._getTds(newNode);
  481. // this.form.getTemplateData("Table$Td", function(data){
  482. tds.each(function(td, idx){
  483. var newContainerJson = Object.clone(this.containers[idx].json);
  484. var oid = this.containers[idx]._getNewId(pid);
  485. var id = oid;
  486. var index = 1;
  487. while (this.form.json.moduleList[id]) {
  488. id = oid + "_" + index;
  489. index++;
  490. }
  491. newContainerJson.id = id;
  492. // newContainerJson.id = this.containers[idx]._getNewId(pid);
  493. this.form.json.moduleList[newContainerJson.id] = newContainerJson;
  494. td.set("id", newContainerJson.id);
  495. }.bind(this));
  496. // }.bind(this));
  497. },
  498. // setOtherNodeEvent: function(){
  499. //// var tds = this.node.getElements("td");
  500. //// tds.addEvent("click", function(e){
  501. //// this.selectedTd(e.target);
  502. //// }.bind(this));
  503. // },
  504. //
  505. // selectedTd: function(td){
  506. // if (this.currentSelectedTd){
  507. // if (this.currentSelectedTd==td){
  508. // return true;
  509. // }else{
  510. // this.unSelectedTd(this.currentSelectedTd);
  511. // }
  512. // }
  513. //
  514. // var top = td.getStyle("border-top");
  515. // var left = td.getStyle("border-left");
  516. // var bottom = td.getStyle("border-bottom");
  517. // var right = td.getStyle("border-right");
  518. // td.store("thisborder", {"top": top, "left": left, "bottom": bottom, "right": right});
  519. //
  520. // td.setStyles({
  521. // "border": "1px dashed #ff6b49"
  522. // });
  523. // this.currentSelectedTd = td;
  524. // },
  525. // unSelectedTd: function(td){
  526. // var border = td.retrieve("thisborder");
  527. // if (border) {
  528. // td.setStyles({
  529. // "border-top": border.top,
  530. // "border-left": border.left,
  531. // "border-bottom": border.bottom,
  532. // "border-right": border.right
  533. // });
  534. // }
  535. // this.currentSelectedTd = null;
  536. // },
  537. getContainerNodes: function(){
  538. //return this.node.getElements("td");
  539. return this._getTds();
  540. },
  541. _preprocessingModuleData: function(){
  542. this.node.clearStyles();
  543. this.json.recoveryStyles = Object.clone(this.json.styles);
  544. if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
  545. if ((value.indexOf("x_processplatform_assemble_surface")!=-1 || value.indexOf("x_portal_assemble_surface")!=-1)){
  546. //需要运行时处理
  547. }else{
  548. var reg = /^border\w*/ig;
  549. if (!key.test(reg)){
  550. if (key){
  551. this.node.setStyle(key, value);
  552. delete this.json.styles[key];
  553. }
  554. }
  555. }
  556. }.bind(this));
  557. if (this.json.styles && this.json.styles.border){
  558. if (!this.table) this.table = this.node.getElement("table");
  559. if( this.json.styles["table-layout"] ){
  560. this.table.setStyle("table-layout",this.json.styles["table-layout"]);
  561. }
  562. //this.table.setStyle("border-collapse","collapse");
  563. if (!this.json.styles["border-collapse"]) this.table.setStyle("border-collapse","separate");
  564. }
  565. this.json.preprocessing = "y";
  566. },
  567. _recoveryModuleData: function(){
  568. if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
  569. this.json.recoveryStyles = null;
  570. if (!this.table) this.table = this.node.getElement("table");
  571. //this.table.setStyle("border-collapse","separate");
  572. },
  573. loadExistedNodeTd: function (cell, moduleData) {
  574. var tdContainer = new MWF.FCTable$Td(this.form);
  575. tdContainer.table = this;
  576. tdContainer.load(moduleData, cell, this);
  577. this.containers.push(tdContainer);
  578. },
  579. deleteTdWithNode: function (cell) {
  580. var module = cell.retrieve("module");
  581. if (module){
  582. this.containers.erase(module);
  583. module.destroy();
  584. }
  585. }
  586. });