问题描述
限时送ChatGPT账号..我应该为 jQuery datepicker buttonImage
属性使用什么值?
我想将 Bootstrap 日历图标与 jQuery 日期选择器一起使用.像这样引用时,我可以在 html 页面中使用图标图像:
当我使用 angular-ui 包装器 ui-date
来包装 jQuery 日期选择器:
<label class="control-label" for="startDate">开始日期</label><div class="控件"><input class="span2" id="startDate" type="text"data-ng-model="formModel.startDate"data-ui-date="formModel.datePickerOptions"data-ng-change="formModel.setAdjustmentDate()"需要 >
控制器将日期选择器选项定义为:
formModel.datePickerOptions = {日期格式:'yy-M-dd',changeMonth: 真,changeYear: 真,buttonImage: '<i class=icon-calendar></i>',buttonImageOnly: 真,showOn: "按钮"};
我实际上应该为 buttonImage 插入什么值?
日期选择器需要一个类似这样的图像 url { buttonImage: "/images/datepicker.gif" }
.
对于你正在做的事情,我推荐你,而不是搞乱 buttonImage 属性只需将图标标记放入 buttonText 值
.value('ui.config', {日期: {日期格式:'mm-dd-yy',minDate : '+1d',showOn : '按钮',buttonText : '<i class="icon-calendar"></i>'}})
What value should I be using for the jQuery datepicker buttonImage
attribute?
I would like to use the Bootstrap calendar icon with the jQuery datepicker. I can use the icon image in the html page when referenced like this:
<i class=icon-calendar></i>
When I use the angular-ui wrapper ui-date
to wrap the jQuery datepicker:
<div class="control-group">
<label class="control-label" for="startDate">Start Date</label>
<div class="controls">
<input class="span2" id="startDate" type="text"
data-ng-model="formModel.startDate"
data-ui-date="formModel.datePickerOptions"
data-ng-change="formModel.setAdjustmentDate()"
required >
</div>
</div>
with the controller defining the datepicker options as:
formModel.datePickerOptions = {
dateFormat: 'yy-M-dd'
,changeMonth: true
,changeYear: true
,buttonImage: '<i class=icon-calendar></i>'
,buttonImageOnly: true
,showOn: "button"
};
What value should I actually be inserting for the buttonImage?
The datepicker is expecting an image url something like this { buttonImage: "/images/datepicker.gif" }
.
For what you are doing, rather than messing with the buttonImage attribute, I recommend you just put the icon markup into the buttonText value
.value('ui.config', {
date: {
dateFormat : 'mm-dd-yy',
minDate : '+1d',
showOn : 'button',
buttonText : '<i class="icon-calendar"></i>'
}
})
这篇关于在 jQuery datepicker buttonImage 属性中引用 Bootstrap 图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论