escape method in abstract input
This commit is contained in:
src/inputs
@ -46,7 +46,7 @@ To create your own input you should inherit from this class.
|
|||||||
@param {DOMElement} element
|
@param {DOMElement} element
|
||||||
**/
|
**/
|
||||||
value2html: function(value, element) {
|
value2html: function(value, element) {
|
||||||
var html = $('<div>').text(value).html();
|
var html = this.escape(value);
|
||||||
$(element).html(html);
|
$(element).html(html);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -120,6 +120,13 @@ To create your own input you should inherit from this class.
|
|||||||
**/
|
**/
|
||||||
clear: function() {
|
clear: function() {
|
||||||
this.$input.val(null);
|
this.$input.val(null);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
method to escape html
|
||||||
|
**/
|
||||||
|
escape: function(str) {
|
||||||
|
return $('<div>').text(str).html();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
List of checkboxes. Internally value stored as javascript array of values.
|
List of checkboxes.
|
||||||
|
Internally value stored as javascript array of values.
|
||||||
|
|
||||||
@class checklist
|
@class checklist
|
||||||
@extends list
|
@extends list
|
||||||
@ -49,6 +50,8 @@ $(function(){
|
|||||||
|
|
||||||
value2str: function(value) {
|
value2str: function(value) {
|
||||||
return $.isArray(value) ? value.join($.trim(this.options.separator)) : '';
|
return $.isArray(value) ? value.join($.trim(this.options.separator)) : '';
|
||||||
|
//it is also possible to sent as array
|
||||||
|
//return value;
|
||||||
},
|
},
|
||||||
|
|
||||||
//parse separated string
|
//parse separated string
|
||||||
|
Reference in New Issue
Block a user