js的传参问题

qq_24702069 2018-08-07 04:37:20
define(["/bi/medicare/javascript/Echarts/config.js"], function() {
"use strict";
function D_DayPicker()
{
};
D_DayPicker.prototype.draw = function( oControlHost )
{
var el = oControlHost.container;
var sHtml = '<div class="f-right"><span class="t-write02 t-12 f-left t-right10 t-lineheight36">选择日期</span><div class="box-radius-search t-right10"><input class="form-control date_picker" id="date-selcet-date" data-position="left top" data-language="zh" data-range="false" data-date-format="yyyy-mm-dd" value="2017-01-01" style="height:25px;"></div></div>';
el.innerHTML = sHtml;
this.oControlHost =oControlHost;
$(document).ready(function(){
$("#date-selcet-date").datepicker({onselect:function(ss){

}});
});
};
D_DayPicker.prototype.pickedFunc = function(ss){
//todo
//...
var fullDateA=this.cmpFullDateStr(ss);
this.oControlTxt_a.setValues( [{"use":fullDateA,"display":fullDateA}] );
this.oControlHost.finish();
};
return D_DayPicker;
});


想把SS这个参数传入传入下面的function中,怎么改呢?现在传不进去。
...全文
65 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
風灬雲 2018-08-07
  • 打赏
  • 举报
回复
按楼上的思路 应该加上
var self=this
$(document).ready(function(){
$("#date-selcet-date").datepicker({onselect:function(ss){
self.pickedFunc(ss);//修改的地方
}});
});
bianbianbian1 2018-08-07
  • 打赏
  • 举报
回复
define(["/bi/medicare/javascript/Echarts/config.js"], function() {
"use strict";
function D_DayPicker() {
};
D_DayPicker.prototype.draw = function( oControlHost ) {
var el = oControlHost.container;
var sHtml = '<div class="f-right"><span class="t-write02 t-12 f-left t-right10 t-lineheight36">选择日期</span><div class="box-radius-search t-right10"><input class="form-control date_picker" id="date-selcet-date" data-position="left top" data-language="zh" data-range="false" data-date-format="yyyy-mm-dd" value="2017-01-01" style="height:25px;"></div></div>';
el.innerHTML = sHtml;
this.oControlHost =oControlHost;
$(document).ready(function(){
$("#date-selcet-date").datepicker({onselect:function(ss){
pickedFunc(ss);//修改的地方
}});
});
};
D_DayPicker.prototype.pickedFunc = function(ss){
//todo
//...
var fullDateA=this.cmpFullDateStr(ss);
this.oControlTxt_a.setValues( [{"use":fullDateA,"display":fullDateA}] );
this.oControlHost.finish();
};
return D_DayPicker;
});

87,937

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧