git-svn-id: https://msi/svn/firstRepo/Management/trunk@49 0f545695-f87b-41b6-9a03-7f16563b5454
This commit is contained in:
@@ -9,6 +9,8 @@ define(['jquery', 'underscore', 'backbone', 'text!controls/window/windowTemplate
|
||||
height: "650px",
|
||||
margin_top: "50px",
|
||||
id: "",
|
||||
isModal: false,
|
||||
autoOpen: true,
|
||||
showCloseButton: true,
|
||||
resizable: true,
|
||||
content: "",
|
||||
@@ -17,6 +19,10 @@ define(['jquery', 'underscore', 'backbone', 'text!controls/window/windowTemplate
|
||||
|
||||
initialize : function (options) {
|
||||
this.data.title = options.title;
|
||||
if(options.isModal !== undefined)
|
||||
this.data.isModal = options.isModal;
|
||||
if(options.autoOpen !== undefined)
|
||||
this.data.autoOpen = options.autoOpen;
|
||||
if(options.width)
|
||||
this.data.width = options.width;
|
||||
if(options.height)
|
||||
@@ -30,7 +36,7 @@ define(['jquery', 'underscore', 'backbone', 'text!controls/window/windowTemplate
|
||||
if(options.resizable !== undefined)
|
||||
this.data.resizable = options.resizable;
|
||||
|
||||
this.data.id = this.id;
|
||||
this.data.id = options.id;
|
||||
//this.el is the root element of Backbone.View. By default, it is a div.
|
||||
//$el is cached jQuery object for the view's element.
|
||||
//append the compiled template into view div container
|
||||
@@ -44,18 +50,28 @@ define(['jquery', 'underscore', 'backbone', 'text!controls/window/windowTemplate
|
||||
this.$el.jqxWindow('setContent', content);
|
||||
},
|
||||
|
||||
open: function(){
|
||||
this.$el.jqxWindow('open');
|
||||
},
|
||||
|
||||
//render the content into div of view
|
||||
render: function(){
|
||||
var self = this;
|
||||
var elem = this.$el;
|
||||
this.$el.jqxWindow({
|
||||
title: this.data.title ,
|
||||
width: this.data.width,
|
||||
height: this.data.height,
|
||||
isModal: this.data.isModal,
|
||||
autoOpen: this.data.autoOpen,
|
||||
showCloseButton: this.data.showCloseButton,
|
||||
content: this.data.content,
|
||||
initContent: this.data.initContentFn
|
||||
});
|
||||
this.$el.on('close', function (event) { elem.remove(); });
|
||||
this.$el.on('close', function (event) {
|
||||
if(self.data.autoOpen)
|
||||
elem.remove();
|
||||
});
|
||||
//return to enable chained calls
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user