this.tpl = depreciated_tpl;
Roo.apply(this, depreciated_config);
}
-
+ this.wrapEl = this.el.wrap().wrap();
+ ///this.el = this.wrapEla.appendChild(document.createElement("div"));
+
if(typeof(this.tpl) == "string"){
this.tpl = new Roo.Template(this.tpl);
this.tpl.compile();
-
+
+
/** @private */
this.addEvents({
* @param {Object} data to be rendered (change this)
*/
"preparedata" : true
+
+
});
+
+
this.el.on({
"click": this.onClick,
"dblclick": this.onDblClick,
this.store = Roo.factory(this.store, Roo.data);
this.setStore(this.store, true);
}
+
+ if ( this.footer && this.footer.xtype) {
+
+ var fctr = this.wrapEl.appendChild(document.createElement("div"));
+
+ this.footer.dataSource = this.store
+ this.footer.container = fctr;
+ this.footer = Roo.factory(this.footer, Roo);
+ fctr.insertFirst(this.el);
+
+ // this is a bit insane - as the paging toolbar seems to detach the el..
+// dom.parentNode.parentNode.parentNode
+ // they get detached?
+ }
+
+
Roo.View.superclass.constructor.call(this);
+
+
};
Roo.extend(Roo.View, Roo.util.Observable, {
* @return {Roo.Element}
*/
getEl : function(){
- return this.el;
+ return this.wrapEl;
},
+
+
/**
* Refreshes the view. - called by datachanged on the store. - do not call directly.
// private
updateChildSize : function(){
+
if(this.resizeChild){
+ Roo.log('in?');
var el = this.el;
var child = this.resizeChild;
var adj = this.adjustments;
if(tag == 'input'){
return w + 2;
}
- if(tag = 'textarea'){
+ if(tag == 'textarea'){
return w-2;
}
}else if(Roo.isOpera){
if(tag == 'input'){
return w + 2;
}
- if(tag = 'textarea'){
+ if(tag == 'textarea'){
return w-2;
}
}
*/
getGroupValue : function(){
return this.el.up('form').child('input[name='+this.el.dom.name+']:checked', true).value;
- }
+ },
+
+
+ onRender : function(ct, position){
+ Roo.form.Checkbox.superclass.onRender.call(this, ct, position);
+
+ if(this.inputValue !== undefined){
+ this.el.dom.value = this.inputValue;
+ }
+
+ this.wrap = this.el.wrap({cls: "x-form-check-wrap"});
+ //this.wrap = this.el.wrap({cls: 'x-menu-check-item '});
+ //var viewEl = this.wrap.createChild({
+ // tag: 'img', cls: 'x-menu-item-icon', style: 'margin: 0px;' ,src : Roo.BLANK_IMAGE_URL });
+ //this.viewEl = viewEl;
+ //this.wrap.on('click', this.onClick, this);
+
+ //this.el.on('DOMAttrModified', this.setFromHidden, this); //ff
+ //this.el.on('propertychange', this.setFromHidden, this); //ie
+
+
+
+ if(this.boxLabel){
+ this.wrap.createChild({tag: 'label', htmlFor: this.el.id, cls: 'x-form-cb-label', html: this.boxLabel});
+ // viewEl.on('click', this.onClick, this);
+ }
+ if(this.checked){
+ this.el.dom.checked = 'checked' ;
+ }
+
+ }
+
+
});//<script type="text/javascript">
/*
insertTag : function(tg)
{
// could be a bit smarter... -> wrap the current selected tRoo..
- if (tg.toLowerCase() == 'span') {
+ if (tg.toLowerCase() == 'span' || tg.toLowerCase() == 'code') {
range = this.createRange(this.getSelection());
- var wrappingNode = this.doc.createElement("span");
+ var wrappingNode = this.doc.createElement(tg.toLowerCase());
wrappingNode.appendChild(range.extractContents());
range.insertNode(wrappingNode);
return;
}
var v = f.getValue();
+ if (f.inputType =='radio') {
+ if (typeof(ret[f.getName()]) == 'undefined') {
+ ret[f.getName()] = ''; // empty..
+ }
+
+ if (!f.el.dom.checked) {
+ return;
+
+ }
+ v = f.el.dom.value;
+
+ }
+
// not sure if this supported any more..
if ((typeof(v) == 'object') && f.getRawValue) {
v = f.getRawValue() ; // dates..
/**
* @event confirm
* Fires when the 'confirm' icon is pressed (add a listener to enable add button)
- * @param {Roo.form.ComboBox} combo This combo box
+ * @param {Roo.form.Signature} combo This combo box
*/
'confirm' : true,
/**
this.svgEl = this.signPanel.createChild({
xmlns : 'http://www.w3.org/2000/svg',
tag : 'svg',
+ id : this.svgID + "-svg",
width: this.width,
height: this.height,
viewBox: '0 0 '+this.width+' '+this.height,
},
{
tag: "line",
+ id: this.svgID + "-svg-l",
x1: "0", // start
y1: (this.height*0.8), // start set the line in 80% of height
x2: this.width, // end
{
cls : ' x-signature-btn x-signature-'+id,
scope: editor, // was editor...
- handler: this.setConfirmed,
+ handler: this.confirmHandler,
clickEvent:'mousedown',
text: this.labels.confirm
}
},
//public
/**
+ * when user is clicked confirm then show this image.....
*
* @return {String} Image Data URI
*/
getImageDataURI : function(){
- var svg = this.svgEl.dom.outerHTML;
+ var svg = this.svgEl.dom.parentNode.innerHTML;
var src = 'data:image/svg+xml;base64,'+window.btoa(svg);
- return src;
+ return src;
},
/**
*
getConfirmed : function(){
return this.isConfirmed;
},
+ /**
+ *
+ * @return {Number} this.width
+ */
+ getWidth : function(){
+ return this.width;
+ },
+ /**
+ *
+ * @return {Number} this.height
+ */
+ getHeight : function(){
+ return this.height;
+ },
// private
getSignature : function(){
return this.signatureTmp;
this.isConfirmed = false;
Roo.form.Signature.superclass.reset.call(this);
},
+ setSignature : function(s){
+ this.signatureTmp = s;
+ this.signPanel.select('#'+ this.svgID + '-svg-r', true).first().attr('fill', '#ffa');
+ this.signPanel.select('#'+ this.svgID + '-svg-p', true).first().attr( 'd', s);
+ this.setValue(s);
+ this.isConfirmed = false;
+ Roo.form.Signature.superclass.reset.call(this);
+ },
test : function(){
// Roo.log(this.signPanel.dom.contentWindow.up())
},
//private
setConfirmed : function(){
+
+
+
+// Roo.log(Roo.get(this.signPanel.dom.contentWindow.r).attr('fill', '#cfc'));
+ },
+ // private
+ confirmHandler : function(){
if(!this.getSignature()){
return;
}
this.signPanel.select('#'+ this.svgID + '-svg-r', true).first().attr('fill', '#cfc');
this.setValue(this.getSignature());
this.isConfirmed = true;
-// Roo.log(Roo.get(this.signPanel.dom.contentWindow.r).attr('fill', '#cfc'));
+
+ Roo.log('in confirm clicked');
+//
+// var valid = true;
+// this.items.each(function(f){
+// if(!f.isValid(true)){
+// valid = false;
+// return false;
+// }
+// });
+// for(var i = 0, len = this.buttons.length; i < len; i++){
+// var btn = this.buttons[i];
+// if(btn.formBind === true && btn.disabled === valid){
+// btn.setDisabled(!valid);
+// }
+// }
+ this.fireEvent('confirm', this);
},
// private
// Subclasses should provide the validation implementation by overriding this
{
case 'ContentPanel': // ContentPanel (el, cfg)
case 'ScrollPanel': // ContentPanel (el, cfg)
+ case 'ViewPanel':
if(cfg.autoCreate) {
ret = new Roo[cfg.xtype](cfg); // new panel!!!!!
} else {
}
break;
-
+
+
+
default:
}
// handle view.xtype
- if (this.view && typeof(this.view.xtype) != 'undefined') {
- this.view.el = this.el.appendChild(document.createElement("div"));
- this.view = Roo.factory(this.view);
- this.view.render && this.view.render(false, ''); // render blank..
- }
-
+
this.addEvents({
});
+
+
+
+
if(this.autoScroll){
this.resizeEl.setStyle("overflow", "auto");
} else {
Roo.ContentPanel.superclass.constructor.call(this);
+ if (this.view && typeof(this.view.xtype) != 'undefined') {
+ this.view.el = this.el.appendChild(document.createElement("div"));
+ this.view = Roo.factory(this.view);
+ this.view.render && this.view.render(false, '');
+ }
+
+
this.fireEvent('render', this);
};
return this.form;
}
// should only have one of theses..
- if (['View', 'JsonView', 'DatePicker'].indexOf(cfg.xtype) > -1) {
- // views..
+ if ([ 'View', 'JsonView', 'DatePicker'].indexOf(cfg.xtype) > -1) {
+ // views.. should not be just added - used named prop 'view''
+
cfg.el = this.el.appendChild(document.createElement("div"));
// factory?
var ret = new Roo.factory(cfg);
- ret.render && ret.render(false, ''); // render blank..
+
+ ret.render && ret.render(false, ''); // render blank..
this.view = ret;
return ret;
}