BootstrapAdmin/Bootstrap.Admin/Content/js/longbow.dataentity.js

29 lines
851 B
JavaScript
Raw Normal View History

2016-10-20 17:55:29 +08:00
(function ($) {
DataEntity = function (options) {
this.options = $.extend({ map: {} }, options);
};
DataEntity.VERSION = "1.0";
DataEntity.Author = "Argo Zhang";
DataEntity.Email = "argo@163.com";
DataEntity.prototype = {
load: function (value) {
for (name in this.options.map) {
$("#" + this.options.map[name]).val(value[name]);
}
},
reset: function () {
for (name in this.options.map) {
$("#" + this.options.map[name]).val("");
}
},
get: function () {
var target = {};
for (name in this.options.map) {
target[name] = $("#" + this.options.map[name]).val();
}
return target;
}
}
}(jQuery));