Property.js 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. MWF.require("MWF.widget.Common", null, false);
  2. MWF.require("MWF.widget.JsonTemplate", null, false);
  3. MWF.xDesktop.requireApp("query.ViewDesigner", "Property", null, false);
  4. MWF.xApplication.query.StatementDesigner.Property = MWF.SDProperty = new Class({
  5. Extends: MWF.xApplication.query.ViewDesigner.Property,
  6. Implements: [Options, Events],
  7. options: {
  8. "style": "default"
  9. },
  10. show: function () {
  11. if (!this.propertyContent) {
  12. this.getHtmlString(function () {
  13. if (this.htmlString) {
  14. this.JsonTemplate = new MWF.widget.JsonTemplate(this.data, this.htmlString);
  15. this.propertyContent = new Element("div", {"styles": {"overflow": "hidden"}}).inject(this.propertyNode);
  16. this.propertyContent.set("html", this.JsonTemplate.load());
  17. this.setEditNodeEvent();
  18. this.setEditNodeStyles(this.propertyContent);
  19. this.loadPropertyTab();
  20. this.loadPersonInput();
  21. this.loadPersonSelectInput();
  22. this.loadViewFilter();
  23. this.loadScriptArea();
  24. this.loadColumnExportEditor();
  25. this.loadJSONArea();
  26. this.loadEventsEditor();
  27. this.loadViewStylesArea();
  28. this.loadPagingStylesArea();
  29. this.loadActionStylesArea();
  30. this.loadActionArea();
  31. this.loadStylesList();
  32. this.loadMaplist();
  33. this.loadDataPathSelect();
  34. }
  35. }.bind(this));
  36. } else {
  37. this.propertyContent.setStyle("display", "block");
  38. }
  39. },
  40. loadDataPathSelect : function(){
  41. var nodes = this.propertyContent.getElements(".MWFDataPathSelect");
  42. nodes.each( function (select) {
  43. select.empty();
  44. var option = new Element("option", {"text": "none", "value" : ""}).inject(select);
  45. this.module.getColumnDataPath().each(function(model){
  46. var option = new Element("option", {
  47. "text": model,
  48. "value": model,
  49. "selected": (this.data[name]==model)
  50. }).inject(select);
  51. }.bind(this));
  52. }.bind(this))
  53. },
  54. loadViewFilter: function () {
  55. var nodes = this.propertyContent.getElements(".MWFViewFilter");
  56. var filtrData = this.view.data.data.filterList;
  57. var customData = this.view.data.data.customFilterList;
  58. nodes.each(function (node) {
  59. MWF.xDesktop.requireApp("query.StatementDesigner", "widget.ViewFilter", function () {
  60. var _slef = this;
  61. new MWF.xApplication.query.StatementDesigner.widget.ViewFilter(node, this.view.designer, {
  62. "filtrData": filtrData,
  63. "customData": customData
  64. }, {
  65. "onChange": function (ids) {
  66. var data = this.getData();
  67. _slef.changeJsonDate(["data", "filterList"], data.data);
  68. _slef.changeJsonDate(["data", "customFilterList"], data.customData);
  69. }
  70. });
  71. }.bind(this));
  72. }.bind(this));
  73. }
  74. });