Property.js 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. }
  34. }.bind(this));
  35. } else {
  36. this.propertyContent.setStyle("display", "block");
  37. }
  38. },
  39. loadViewFilter: function () {
  40. var nodes = this.propertyContent.getElements(".MWFViewFilter");
  41. //var filtrData = this.view.data.data.filterList;
  42. var customData = this.view.data.data.customFilterList;
  43. nodes.each(function (node) {
  44. MWF.xDesktop.requireApp("query.StatementDesigner", "widget.ViewFilter", function () {
  45. var _slef = this;
  46. new MWF.xApplication.query.StatementDesigner.widget.ViewFilter(node, this.view.designer, {
  47. // "filtrData": filtrData,
  48. "customData": customData
  49. }, {
  50. "onChange": function (ids) {
  51. var data = this.getData();
  52. // _slef.changeJsonDate(["data", "filterList"], data.data);
  53. _slef.changeJsonDate(["data", "customFilterList"], data.customData);
  54. }
  55. });
  56. }.bind(this));
  57. }.bind(this));
  58. }
  59. });