BusinessMetadataContainerLayoutView.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. define([ "require", "backbone", "hbs!tmpl/business_metadata/BusinessMetadataContainerLayoutView_tmpl" ], function(require, Backbone, BusinessMetadataContainerLayoutViewTmpl) {
  2. "use strict";
  3. var BusinessMetadataContainerLayoutView = Backbone.Marionette.LayoutView.extend({
  4. _viewName: "BusinessMetadataContainerLayoutView",
  5. template: BusinessMetadataContainerLayoutViewTmpl,
  6. regions: {
  7. RBusinessMetadataDetailContainer: "#r_businessMetadataDetailContainer",
  8. RBusinessMetadataAttrContainer: "#r_businessMetadataAttrContainer"
  9. },
  10. ui: {},
  11. events: function() {},
  12. initialize: function(options) {
  13. _.extend(this, options);
  14. },
  15. bindEvents: function() {},
  16. onRender: function() {
  17. this.updateView();
  18. },
  19. updateView: function() {
  20. this.model = this.businessMetadataDefCollection.fullCollection.findWhere({
  21. guid: this.guid
  22. }), this.renderBusinessMetadataDetailLayoutView(), this.renderBusinessMetadataAttrLayoutView();
  23. },
  24. renderBusinessMetadataDetailLayoutView: function() {
  25. var that = this;
  26. require([ "views/business_metadata/BusinessMetadataDetailLayoutView" ], function(BusinessMetadataDetailLayoutView) {
  27. that.isDestroyed || that.RBusinessMetadataDetailContainer.show(new BusinessMetadataDetailLayoutView({
  28. businessMetadataDefCollection: that.businessMetadataDefCollection,
  29. guid: that.guid,
  30. model: that.model,
  31. enumDefCollection: that.enumDefCollection,
  32. typeHeaders: that.typeHeaders
  33. }));
  34. });
  35. },
  36. renderBusinessMetadataAttrLayoutView: function() {
  37. var that = this;
  38. require([ "views/business_metadata/BusinessMetadataAttrTableLayoutView" ], function(BusinessMetadataAttrTableLayoutView) {
  39. that.isDestroyed || that.RBusinessMetadataAttrContainer.show(new BusinessMetadataAttrTableLayoutView({
  40. businessMetadataDefCollection: that.businessMetadataDefCollection,
  41. model: that.model,
  42. guid: that.guid,
  43. typeHeaders: that.typeHeaders,
  44. enumDefCollection: that.enumDefCollection,
  45. entityDefCollection: that.entityDefCollection
  46. }));
  47. });
  48. }
  49. });
  50. return BusinessMetadataContainerLayoutView;
  51. });