add prerender method in inputs to fix bug on second open

This commit is contained in:
vitalets
2013-01-10 23:15:32 +04:00
parent 1a3f3fc725
commit 473a9d9126
6 changed files with 125 additions and 70 deletions

@ -21,10 +21,16 @@ To create your own input you can inherit from this class.
init: function(type, options, defaults) {
this.type = type;
this.options = $.extend({}, defaults, options);
},
/*
this method called before render to init $tpl that is inserted in DOM
*/
prerender: function() {
this.$tpl = $(this.options.tpl); //whole tpl as jquery object
this.$input = this.$tpl; //control itself, can be changed in render method
this.$clear = null; //clear button
this.error = null; //error message, if input cannot be rendered
this.error = null; //error message, if input cannot be rendered
},
/**