2c8c3b8e24b1653fcc0e55088ef901a81ccb4d1d.svn-base 975 B

123456789101112131415161718192021222324252627282930313233
  1. (function() {
  2. BemsWebApplication.CmMenuViewModel = function(data) {
  3. this.SiteId = ko.observable();
  4. this.MenuId = ko.observable();
  5. this.Used = ko.observable();
  6. this.MenuPath = ko.observable();
  7. this.Name = ko.observable();
  8. if(data)
  9. this.fromJS(data);
  10. };
  11. $.extend(BemsWebApplication.CmMenuViewModel.prototype, {
  12. toJS: function() {
  13. return {
  14. SiteId: this.SiteId(),
  15. MenuId: this.MenuId(),
  16. Used: this.Used(),
  17. MenuPath: this.MenuPath(),
  18. Name: this.Name(),
  19. };
  20. },
  21. fromJS: function(data) {
  22. if(data) {
  23. this.SiteId(data.SiteId);
  24. this.MenuId(data.MenuId);
  25. this.Used(data.Used);
  26. this.MenuPath(data.MenuPath);
  27. this.Name(data.Name);
  28. }
  29. }
  30. });
  31. })();