PreSelectWeeks.js 855 B

1234567891011121314151617181920212223242526272829303132
  1. var windowID;
  2. var inputData;
  3. var educationSchedulingID;
  4. var weeklyNums;
  5. $.parser.onComplete = function () {
  6. $(function () {
  7. windowID = $.SystemGeneral.getUrlParam("WindowID");
  8. inputData = top.$("#" + windowID).data("inputData");
  9. weeklyNums = inputData.sort(function (a, b) { return parseInt(a) - parseInt(b); });
  10. var gridData = { rows: $.map(weeklyNums, function (x) { return { WeekNum: x }; }), total: weeklyNums.length };
  11. $("#dgWeekList").cmsXDataTable("loadData", gridData);
  12. });
  13. };
  14. function validChoose() {
  15. var d = [];
  16. $.each($("#dgWeekList").cmsXDataTable("getSelections"), function (index) {
  17. d.push(this.WeekNum);
  18. });
  19. return d;
  20. }
  21. function save() {
  22. var d = validChoose();
  23. top.$("#" + windowID).data("resultData", d);
  24. top.$("#" + windowID).dialog("close");
  25. }