InvalidInfor.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. MWF.xDesktop.requireApp("Attendance", "Explorer", null, false);
  2. MWF.xDesktop.requireApp("Template", "MDomItem", null, false);
  3. MWF.xDesktop.requireApp("Selector", "package", null, false);
  4. MWF.xApplication.Attendance.InvalidInfor = new Class({
  5. Extends: MWF.xApplication.Attendance.Explorer,
  6. Implements: [Options, Events],
  7. initialize: function(node, app, actions, options){
  8. this.setOptions(options);
  9. this.app = app;
  10. this.path = "../x_component_Attendance/$InvalidInfor/";
  11. this.cssPath = "../x_component_Attendance/$InvalidInfor/"+this.options.style+"/css.wcss";
  12. this._loadCss();
  13. this.actions = actions;
  14. this.node = $(node);
  15. this.initData();
  16. if (!this.personActions) this.personActions = new MWF.xAction.org.express.RestActions();
  17. },
  18. loadView : function(){
  19. this.view = new MWF.xApplication.Attendance.InvalidInfor.View(this.elementContentNode, this.app,this, this.viewData, this.options.searchKey );
  20. this.view.load();
  21. this.setContentSize();
  22. },
  23. removeSelectedDocument: function(){
  24. this.view.items.each( function( it ){
  25. if( it.checkboxElement.get("checked" ) ){
  26. this.actions.deleteDetail(it.data.id, null, null, false );
  27. this.view.reload();
  28. this.app.notice(this.app.lp.deleteDocumentOK, "success");
  29. }
  30. }.bind(this))
  31. }
  32. });
  33. MWF.xApplication.Attendance.InvalidInfor.View = new Class({
  34. Extends: MWF.xApplication.Attendance.Explorer.View,
  35. _createItem: function(data){
  36. return new MWF.xApplication.Attendance.InvalidInfor.Document(this.table, data, this.explorer, this);
  37. },
  38. _getCurrentPageData: function(callback, count){
  39. if(!count)count=20;
  40. var id = (this.items.length) ? this.items[this.items.length-1].data.id : "(0)";
  41. var filter = {"recordStatus": -1 };
  42. this.actions.listDetailFilterNext( id, count, filter, function(json){
  43. if( callback )callback(json);
  44. }.bind(this))
  45. },
  46. _removeDocument: function(document, all){
  47. this.actions.deleteDetail(document.id, function(json){
  48. this.explorer.view.reload();
  49. this.app.notice(this.app.lp.deleteDocumentOK, "success");
  50. }.bind(this));
  51. },
  52. _createDocument: function(){
  53. },
  54. _openDocument: function( documentData ){
  55. }
  56. });
  57. MWF.xApplication.Attendance.InvalidInfor.Document = new Class({
  58. Extends: MWF.xApplication.Attendance.Explorer.Document
  59. });