add wysi input, refactor all inputs to append $tpl to form before render()
This commit is contained in:
@@ -58,11 +58,8 @@ $(function(){
|
||||
},
|
||||
|
||||
render: function () {
|
||||
Date.superclass.render.call(this);
|
||||
this.$input.datepicker(this.options.datepicker);
|
||||
},
|
||||
|
||||
postrender: function() {
|
||||
|
||||
//"clear" link
|
||||
if(this.options.clear) {
|
||||
this.$clear = $('<a href="#"></a>').html(this.options.clear).click($.proxy(function(e){
|
||||
@@ -72,9 +69,9 @@ $(function(){
|
||||
}, this));
|
||||
|
||||
this.$tpl.parent().append($('<div class="editable-clear">').append(this.$clear));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
value2html: function(value, element) {
|
||||
var text = value ? this.dpg.formatDate(value, this.parsedViewFormat, this.options.datepicker.language) : '';
|
||||
Date.superclass.value2html(text, element);
|
||||
|
@@ -14,16 +14,9 @@ Automatically shown in inline mode.
|
||||
|
||||
$.extend(DateField.prototype, {
|
||||
render: function () {
|
||||
this.$tpl = $(this.options.tpl);
|
||||
this.$input = this.$tpl.find('input');
|
||||
|
||||
if(this.options.inputclass) {
|
||||
this.$input.addClass(this.options.inputclass);
|
||||
}
|
||||
|
||||
if (this.options.placeholder) {
|
||||
this.$input.attr('placeholder', this.options.placeholder);
|
||||
}
|
||||
this.setClass();
|
||||
this.setAttr('placeholder');
|
||||
|
||||
this.$tpl.datepicker(this.options.datepicker);
|
||||
|
||||
@@ -73,10 +66,7 @@ Automatically shown in inline mode.
|
||||
weekStart: 0,
|
||||
startView: 0,
|
||||
autoclose: true
|
||||
},
|
||||
|
||||
/* disable clear link */
|
||||
clear: false
|
||||
}
|
||||
});
|
||||
|
||||
$.fn.editabletypes.datefield = DateField;
|
||||
|
Reference in New Issue
Block a user