|

楼主 |
发表于 2017-10-9 17:17:55
|
显示全部楼层
代码如下:这个class:active-y是在_this.setYear();的回调函数里设置的,像我那样写的话无法获取到值,具体写么修改
- Model.prototype.modelModelConstructDone = function(event) {
- // 加载时间选择按钮
- asCore.ajax("/oa/queryCurrentWeeksAction", null, function(data, flag, mes) {
- if (flag == "success") {
- currentWeekInfo = data;
- factWeekInfo = data;
- var year = {
- cYear : currentWeekInfo.data.cYear,
- years : []
- };
- for (var i = 0; i < 5; i++) {
- year.years.push({
- val : currentWeekInfo.data.cYear - i
- });
- }
- // 加载年份按钮
- _this.setYear(year);
- // 加载月份按钮
- _this.setMonth();
- // 加载周别按钮
- _this.setWeek();
- } else {
- asCore.toast(mes);
- }
- });
- var cy=$(".active-y").attr("value");
- var cm=$(".x-fl-button .active-m").attr("value");
- var cw=$(".active-w").attr("value");
- debugger
- };
复制代码
|
|