Datatable.js 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. MWF.xDesktop.requireApp("process.Xform", "Datatable", null, false);
  2. MWF.xApplication.cms.Xform.Datatable = MWF.CMSDatatable = new Class({
  3. Extends: MWF.APPDatatable,
  4. deleteAttachment: function( attId ){
  5. this.form.documentAction.deleteAttachment(attId, this.form.businessData.work.id);
  6. },
  7. saveFormData: function(){
  8. this.form.saveFormData();
  9. },
  10. validationConfigItem: function(routeName, data){
  11. var flag = (data.status=="all") ? true: (routeName == "publ" || routeName == "publish");
  12. if (flag){
  13. var n = this.getData();
  14. var v = (data.valueType=="value") ? n : n.length;
  15. switch (data.operateor){
  16. case "isnull":
  17. if (!v){
  18. this.notValidationMode(data.prompt);
  19. return false;
  20. }
  21. break;
  22. case "notnull":
  23. if (v){
  24. this.notValidationMode(data.prompt);
  25. return false;
  26. }
  27. break;
  28. case "gt":
  29. if (v>data.value){
  30. this.notValidationMode(data.prompt);
  31. return false;
  32. }
  33. break;
  34. case "lt":
  35. if (v<data.value){
  36. this.notValidationMode(data.prompt);
  37. return false;
  38. }
  39. break;
  40. case "equal":
  41. if (v==data.value){
  42. this.notValidationMode(data.prompt);
  43. return false;
  44. }
  45. break;
  46. case "neq":
  47. if (v!=data.value){
  48. this.notValidationMode(data.prompt);
  49. return false;
  50. }
  51. break;
  52. case "contain":
  53. if (v.indexOf(data.value)!=-1){
  54. this.notValidationMode(data.prompt);
  55. return false;
  56. }
  57. break;
  58. case "notcontain":
  59. if (v.indexOf(data.value)==-1){
  60. this.notValidationMode(data.prompt);
  61. return false;
  62. }
  63. break;
  64. }
  65. }
  66. return true;
  67. }
  68. });
  69. MWF.xApplication.cms.Xform.Datatable$Title = MWF.CMSDatatable$Title = new Class({
  70. Extends: MWF.APPDatatable$Title
  71. });
  72. MWF.xApplication.cms.Xform.Datatable$Data = MWF.CMSDatatable$Data = new Class({
  73. Extends: MWF.APPDatatable$Data
  74. });