Table.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. MWF.xDesktop.requireApp("portal.PageDesigner", "Module.Table$Td", null, false);
  2. MWF.xApplication.portal.PageDesigner.Module.Table = MWF.PCTable = new Class({
  3. Extends: MWF.FCTable,
  4. Implements: [Options, Events],
  5. options: {
  6. "style": "default",
  7. "propertyPath": "/x_component_portal_PageDesigner/Module/Table/table.html",
  8. "propertyMultiPath": "/x_component_portal_PageDesigner/Module/Table$Td/table$tdMulti.html"
  9. },
  10. initialize: function(form, options){
  11. this.setOptions(options);
  12. this.path = "/x_component_portal_PageDesigner/Module/Table/";
  13. this.cssPath = "/x_component_portal_PageDesigner/Module/Table/"+this.options.style+"/css.wcss";
  14. this._loadCss();
  15. this.moduleType = "component";
  16. this.moduleName = "table";
  17. this.form = form;
  18. this.container = null;
  19. this.containerNode = null;
  20. this.containers = [];
  21. this.elements = [];
  22. this.selectedMultiTds = [];
  23. },
  24. _getContainers: function(){
  25. var tds = this.node.getElements("td");
  26. this.form.getTemplateData("Table$Td", function(data){
  27. tds.each(function(td){
  28. var json = this.form.getDomjson(td);
  29. var tdContainer = null;
  30. if (!json){
  31. var moduleData = Object.clone(data);
  32. tdContainer = new MWF.PCTable$Td(this.form);
  33. tdContainer.table = this;
  34. tdContainer.load(moduleData, td, this);
  35. }else{
  36. tdContainer = new MWF.PCTable$Td(this.form);
  37. tdContainer.table = this;
  38. tdContainer.load(json, td, this);
  39. }
  40. this.containers.push(tdContainer);
  41. }.bind(this));
  42. }.bind(this));
  43. }
  44. });