我已经从代码后面动态生成了文本框,一个类"DateTextBox"被设置为动态生成的所有文本框控件.将datepicker控件设置为类,但每个文本控件都需要不同的日期格式.如何设置每个文本框的DatePicker的日期格式?
动态生成的文本框控件html - >
<input type="text" class="DateTextBox" data-dateformat='dd/mm/yy'>
</br>
<input type="text" class="DateTextBox" data-dateformat='dd/MM/yy'>
</br>
<input type="text" class="DateTextBox" data-dateformat='d/M/yy'>
</br>
<input type="text" class="DateTextBox" data-dateformat='d/MM/yy'>
Run Code Online (Sandbox Code Playgroud)
datepicker jquery - >
$('.DateTextBox').datepicker({ dateFormat: $(this).attr('data-dateformat'),
showButtonPanel: true,
changeMonth: true,
changeYear: true,
defaultDate: new Date(),
changeMonth: true,
changeYear: true
});
Run Code Online (Sandbox Code Playgroud)
检查jsFiddler
是否可以在 pdfmake 中的文本开头之前添加制表符空格。我确实尝试过“\t”,但是当我们将其添加到初始值或字符串开始之前时,它不起作用。
这就是我尝试的
var dd = {
> content: [{
> text: 'Cost',
> style: 'header',
> decoration: 'underline' }, {
> text: '\tInvesting in a granulator is a wise move because of the enormous long-term savings of virgin raw materials and other benefits
> that you gain.',
> style: 'para' }],
> styles: {
> header: {
> fontSize: 20,
> bold: true
> },
> para: {
> fontSize: 10,
> margin: [0, 9, 0, 9]
> …Run Code Online (Sandbox Code Playgroud)