亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用 Controller 中的結構初始化 TempusDominus datetimepicker

使用 Controller 中的結構初始化 TempusDominus datetimepicker

陪伴而非守候 2021-10-14 13:18:53
我有一個 tempusdominus datetimepicker 和一個鏈接的選擇。我從控制器中得到一個由 Map> 組成的結構,其中鍵是應該在 datetimepicker 中啟用的日期,每個日期都有一個小時列表,當用戶選擇日期時,我必須在鏈接的選擇中顯示這些小時。我的jsp中有這個:<div class="row">     <div class="col-sm-6 labels">        <div class="form-group">            <label>Date</label>            <div class="input-group date" id="fechaCita" data-target-input="nearest">            <input type="text" class="form-control datetimepicker-input" data-target="#fechaCita"/>            <div class="input-group-append" data-target="#fechaCita" data-toggle="datetimepicker">                 <div class="input-group-text"><i class="fa fa-calendar"></i></div>            </div>        </div>    </div></div><div class="col-sm-4 labels">    <div class="form-group">        <label>Time</label>        <div class="input-group date" id="horaInicio">            <form:select path="horario.horaInicio" id="selectHoraCita" class="form-control">                <form:option value="">--</form:option>            </form:select>            <input type="hidden" id="horaInicioSelected" />        </div>    </div></div>然后在我的 javascript 文件中,我有以下內容:$(function() {    $.ajax({        url: rutaBase + '/huecos.json',        success: { function(huecos) {            console.log('Huecos' + huecos);            var enabledDates = [];            for (var key in huecos) {                  if (huecos.hasOwnProperty(key)) {                    enabledDates.push(key);                  }                }            $('#fechaCita').datetimepicker({                format : 'DD/MM/YYYY', // Solo se mostrará la fecha                enabledDates : enabledDates,                icons                     }                });            });        }        }    });});這個 Ajax 調用得到類似 {2019-09-12=[12:00 - 13:00, 14:30 - 15:00], 2019-09-13=[10:00 - 11:00]} 的結果.但這不起作用,我得到一個帶有日期和時間的日期時間選擇器,但在控制臺上什么也沒有...... -13"] 它有效,但如果我嘗試從 ajax 調用中獲取它們,則無效。我對 ajax/jquery/javascript 毫無用處,所以我確定我做錯了什么......
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 241 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號