Table.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  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. var fromLogList;
  202. if(this.form.history)fromLogList = this.createHistoryLogList(this.form.selectedModules);
  203. var firstModuleObj = this.form._getFirstMultiSelectedModule();
  204. var firstModule = firstModuleObj.module;
  205. // var n=0;
  206. var td = firstModule.node;
  207. var colspan = 0;
  208. while (td && this.form.selectedModules.indexOf(td.retrieve("module"))!=-1 ){
  209. var tmpColspan = td.get("colspan").toInt() || 1;
  210. colspan = colspan+tmpColspan;
  211. td = td.getNext("td");
  212. }
  213. var maxRowIndex = Number.NEGATIVE_INFINITY;
  214. var minRowIndex = Number.POSITIVE_INFINITY;
  215. this.form.selectedModules.each(function(module, idx){
  216. var rIdx = module.node.getParent("tr").rowIndex;
  217. var tmpRowspan = module.node.get("rowspan").toInt() || 1;
  218. var rows = rIdx+tmpRowspan-1;
  219. maxRowIndex = Math.max(maxRowIndex, rows);
  220. minRowIndex = Math.min(minRowIndex, rows);
  221. }.bind(this));
  222. var rowspan = maxRowIndex-minRowIndex+1;
  223. if (colspan>1){
  224. firstModule.node.set("colspan", colspan);
  225. firstModule.json.properties.colspan = colspan;
  226. }else{
  227. firstModule.node.set("colspan", 1);
  228. delete firstModule.node.colspan;
  229. delete firstModule.json.properties.colspan;
  230. }
  231. if (rowspan>1){
  232. firstModule.node.set("rowspan", rowspan);
  233. firstModule.json.properties.rowspan = rowspan;
  234. }else{
  235. firstModule.node.set("rowspan", 1);
  236. delete firstModule.node.rowspan;
  237. delete firstModule.json.properties.rowspan;
  238. }
  239. while (this.form.selectedModules.length){
  240. var module = this.form.selectedModules[0];
  241. this.form.selectedModules.erase(module);
  242. if (module!==firstModule){
  243. var modules = module._getSubModule();
  244. modules.each(function(module){
  245. module._moveTo(firstModule);
  246. });
  247. this.containers.erase(module);
  248. module.destroy();
  249. }
  250. }
  251. firstModule.selected();
  252. this.addHistoryLog("mergeCell", firstModule, fromLogList, firstModule.json.id, firstModule.json.type );
  253. }
  254. },
  255. _getContainers: function(){
  256. //var tds = this.node.getElements("td");
  257. var tds = this._getTds();
  258. this.form.getTemplateData("Table$Td", function(data){
  259. tds.each(function(td){
  260. var json = this.form.getDomjson(td);
  261. var tdContainer = null;
  262. if (!json){
  263. var moduleData = Object.clone(data);
  264. tdContainer = new MWF.FCTable$Td(this.form);
  265. tdContainer.table = this;
  266. tdContainer.load(moduleData, td, this);
  267. }else{
  268. var moduleData = Object.clone(data);
  269. Object.merge(moduleData, json);
  270. Object.merge(json, moduleData);
  271. tdContainer = new MWF.FCTable$Td(this.form);
  272. tdContainer.table = this;
  273. tdContainer.load(json, td, this);
  274. }
  275. this.containers.push(tdContainer);
  276. }.bind(this));
  277. }.bind(this));
  278. },
  279. _getElements: function(){
  280. // this.elements.push(this);
  281. var captions = this.node.getElements("caption");
  282. captions.each(function(caption){
  283. var json = this.form.getDomjson(caption);
  284. var el = null;
  285. if (!json){
  286. this.form.getTemplateData("Common", function(data){
  287. var moduleData = Object.clone(data);
  288. el = new MWF.FCCommon(this.form);
  289. el.table = this;
  290. el.load(moduleData, caption, this);
  291. }.bind(this));
  292. }else{
  293. el = new MWF.FCCommon(this.form);
  294. el.table = this;
  295. el.load(json, caption, this);
  296. }
  297. this.elements.push(el);
  298. }.bind(this));
  299. },
  300. _createNode: function(callback){
  301. var module = this;
  302. var url = this.path+"tableCreate.html";
  303. MWF.require("MWF.widget.Dialog", function(){
  304. var size = $(document.body).getSize();
  305. var x = size.x/2-180;
  306. var y = size.y/2-130;
  307. var dlg = new MWF.DL({
  308. "title": "Create Table",
  309. "style": "property",
  310. "top": y,
  311. "left": x-40,
  312. "fromTop":size.y/2-65,
  313. "fromLeft": size.x/2,
  314. "width": 360,
  315. "height": 260,
  316. "url": url,
  317. "lp": MWF.xApplication.process.FormDesigner.LP.propertyTemplate,
  318. "buttonList": [
  319. {
  320. "text": MWF.APPFD.LP.button.ok,
  321. "action": function(){
  322. module._createTableNode();
  323. callback();
  324. this.close();
  325. }
  326. }
  327. ]
  328. });
  329. dlg.show();
  330. }.bind(this));
  331. },
  332. _createTableNode: function(){
  333. var rows = $("MWFNewTableLine").get("value");
  334. var cols = $("MWFNewTableColumn").get("value");
  335. var width = $("MWFNewTableWidth").get("value");
  336. var widthUnitNode = $("MWFNewTableWidthUnit");
  337. var widthUnit = widthUnitNode.options[widthUnitNode.selectedIndex].value;
  338. var border = $("MWFNewTableBorder").get("value");
  339. var cellpadding = $("MWFNewTableCellpadding").get("value");
  340. var cellspacing = $("MWFNewTableCellspacing").get("value");
  341. var w = "";
  342. if (widthUnit=="percent"){
  343. w = width+"%";
  344. }else{
  345. w = width+"px";
  346. }
  347. this.json.properties.width = w;
  348. this.json.properties.border = border;
  349. this.json.properties.cellpadding = cellpadding;
  350. this.json.properties.cellspacing = cellspacing;
  351. var tableHTML = "<table border=\""+border+"\" cellpadding=\""+cellpadding+"\" cellspacing=\""+cellspacing+"\" width=\""+w+"\" align=\"center\">";
  352. for (var i=0; i<rows.toInt(); i++){
  353. tableHTML += "<tr>";
  354. for (var j=0; j<cols.toInt(); j++){
  355. tableHTML += "<td></td>";
  356. }
  357. tableHTML += "</tr>";
  358. }
  359. tableHTML += "</table>";
  360. this.node = this.node = new Element("div", {
  361. "id": this.json.id,
  362. "MWFType": "table",
  363. "html": tableHTML,
  364. "styles": this.css.moduleNode,
  365. "events": {
  366. "selectstart": function(e){
  367. e.preventDefault();
  368. }
  369. }
  370. }).inject(this.form.node);
  371. //if (w!="100%"){
  372. // this.node.setStyle("width", w);
  373. //}
  374. },
  375. _dragComplete: function(){
  376. if (!this.node){
  377. this._createNode(function(){
  378. this._dragMoveComplete();
  379. }.bind(this));
  380. }else{
  381. this._dragMoveComplete();
  382. }
  383. },
  384. _dragMoveComplete: function(){
  385. this._resetTreeNode();
  386. this.node.inject(this.copyNode, "before");
  387. this._initModule();
  388. var thisDisplay = this.node.retrieve("thisDisplay");
  389. if (thisDisplay){
  390. this.node.setStyle("display", thisDisplay);
  391. }
  392. if (this.copyNode) this.copyNode.destroy();
  393. if (this.moveNode) this.moveNode.destroy();
  394. this.moveNode = null;
  395. this.copyNode = null;
  396. this.nextModule = null;
  397. this.form.moveModule = null;
  398. this.form.json.moduleList[this.json.id] = this.json;
  399. this.selected();
  400. if( this.operation && !this.historyAddDelay ){
  401. this.addHistoryLog( this.operation, null, this.fromLog );
  402. }
  403. if( !this.historyAddDelay ){
  404. this.operation = null;
  405. this.fromLog = null;
  406. }
  407. },
  408. setPropertiesOrStyles: function(name){
  409. if (name=="styles"){
  410. try{
  411. this.setCustomStyles();
  412. }catch(e){}
  413. // var border = this.node.getStyle("border");
  414. // this.node.clearStyles();
  415. // this.node.setStyles(this.css.moduleNode);
  416. // this.node.setStyle("border", border);
  417. // Object.each(this.json.styles, function(value, key){
  418. // var reg = /^border\w*/ig;
  419. // if (!key.test(reg)){
  420. // this.node.setStyle(key, value);
  421. // }
  422. // }.bind(this));
  423. }else if(name=="tableStyles"){
  424. this.parseStyles( this.table, this.json.tableStyles );
  425. }
  426. if (name=="properties"){
  427. this.node.getFirst().setProperties(this.json.properties);
  428. if (this.json.properties.cellspacing==="0"){
  429. this.node.getFirst().setProperties({"cellspacing": "1"});
  430. }
  431. //if (this.json.properties.width){
  432. // if (this.json.properties.width!="100%"){
  433. // this.node.setStyle("width", this.json.properties.width);
  434. // }
  435. //}
  436. }
  437. },
  438. _setEditStyle_custom: function(name, obj, oldValue){
  439. if (name=="id"){
  440. if (oldValue && this.json.id!=oldValue){
  441. var reg = new RegExp("^"+oldValue, "i");
  442. this.containers.each(function(container){
  443. var id = container.json.id;
  444. var newId = id.replace(reg, this.json.id);
  445. container.json.id = newId;
  446. delete this.form.json.moduleList[id];
  447. this.form.json.moduleList[newId] = container.json;
  448. container._setEditStyle("id");
  449. }.bind(this));
  450. }
  451. }
  452. if (name=="titleTdStyles") this.setTabStyles();
  453. if (name=="contentTdStyles") this.setTabStyles();
  454. if (name=="layoutTdStyles") this.setTabStyles();
  455. },
  456. setTabStyles: function(){
  457. this.containers.each(function(module){
  458. //if (module.json.cellType=="title"){
  459. //
  460. //}
  461. //if (module.json.cellType=="content"){
  462. //
  463. //}
  464. //if (module.json.cellType=="layout"){
  465. //
  466. //}
  467. module.setCustomStyles();
  468. }.bind(this));
  469. },
  470. setAllStyles: function(){
  471. this.setPropertiesOrStyles("styles");
  472. this.setPropertiesOrStyles("tableStyles");
  473. this.setPropertiesOrStyles("properties");
  474. this.setTabStyles();
  475. this.reloadMaplist();
  476. },
  477. copyComponentJsonData: function(newNode, pid){
  478. //var tds = newNode.getElements("td");
  479. var tds = this._getTds(newNode);
  480. // this.form.getTemplateData("Table$Td", function(data){
  481. tds.each(function(td, idx){
  482. var newContainerJson = Object.clone(this.containers[idx].json);
  483. var oid = this.containers[idx]._getNewId(pid);
  484. var id = oid;
  485. var index = 1;
  486. while (this.form.json.moduleList[id]) {
  487. id = oid + "_" + index;
  488. index++;
  489. }
  490. newContainerJson.id = id;
  491. // newContainerJson.id = this.containers[idx]._getNewId(pid);
  492. this.form.json.moduleList[newContainerJson.id] = newContainerJson;
  493. td.set("id", newContainerJson.id);
  494. }.bind(this));
  495. // }.bind(this));
  496. },
  497. // setOtherNodeEvent: function(){
  498. //// var tds = this.node.getElements("td");
  499. //// tds.addEvent("click", function(e){
  500. //// this.selectedTd(e.target);
  501. //// }.bind(this));
  502. // },
  503. //
  504. // selectedTd: function(td){
  505. // if (this.currentSelectedTd){
  506. // if (this.currentSelectedTd==td){
  507. // return true;
  508. // }else{
  509. // this.unSelectedTd(this.currentSelectedTd);
  510. // }
  511. // }
  512. //
  513. // var top = td.getStyle("border-top");
  514. // var left = td.getStyle("border-left");
  515. // var bottom = td.getStyle("border-bottom");
  516. // var right = td.getStyle("border-right");
  517. // td.store("thisborder", {"top": top, "left": left, "bottom": bottom, "right": right});
  518. //
  519. // td.setStyles({
  520. // "border": "1px dashed #ff6b49"
  521. // });
  522. // this.currentSelectedTd = td;
  523. // },
  524. // unSelectedTd: function(td){
  525. // var border = td.retrieve("thisborder");
  526. // if (border) {
  527. // td.setStyles({
  528. // "border-top": border.top,
  529. // "border-left": border.left,
  530. // "border-bottom": border.bottom,
  531. // "border-right": border.right
  532. // });
  533. // }
  534. // this.currentSelectedTd = null;
  535. // },
  536. getContainerNodes: function(){
  537. //return this.node.getElements("td");
  538. return this._getTds();
  539. },
  540. _preprocessingModuleData: function(){
  541. this.node.clearStyles();
  542. this.json.recoveryStyles = Object.clone(this.json.styles);
  543. if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
  544. if ((value.indexOf("x_processplatform_assemble_surface")!=-1 || value.indexOf("x_portal_assemble_surface")!=-1)){
  545. //需要运行时处理
  546. }else{
  547. var reg = /^border\w*/ig;
  548. if (!key.test(reg)){
  549. if (key){
  550. this.node.setStyle(key, value);
  551. delete this.json.styles[key];
  552. }
  553. }
  554. }
  555. }.bind(this));
  556. if (this.json.styles && this.json.styles.border){
  557. if (!this.table) this.table = this.node.getElement("table");
  558. if( this.json.styles["table-layout"] ){
  559. this.table.setStyle("table-layout",this.json.styles["table-layout"]);
  560. }
  561. //this.table.setStyle("border-collapse","collapse");
  562. if (!this.json.styles["border-collapse"]) this.table.setStyle("border-collapse","separate");
  563. }
  564. this.json.preprocessing = "y";
  565. },
  566. _recoveryModuleData: function(){
  567. if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
  568. this.json.recoveryStyles = null;
  569. if (!this.table) this.table = this.node.getElement("table");
  570. //this.table.setStyle("border-collapse","separate");
  571. },
  572. loadExistedNodeTd: function (cell, moduleData) {
  573. var tdContainer = new MWF.FCTable$Td(this.form);
  574. tdContainer.table = this;
  575. tdContainer.load(moduleData, cell, this);
  576. this.containers.push(tdContainer);
  577. },
  578. deleteTdWithNode: function (cell) {
  579. var module = cell.retrieve("module");
  580. if (module){
  581. this.containers.erase(module);
  582. module.destroy();
  583. }
  584. }
  585. });