在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/UI  網(wǎng)絡(luò)安全/ easyui時(shí)間控件設(shè)置默認(rèn)值不成功

easyui時(shí)間控件設(shè)置默認(rèn)值不成功

HTML

<th id="setStartDate" data-options="field:'queryBeginDate',editor: { type: 'datebox', options: { required: true,formatter:doFormatDate,parser:doParser,editable:false } }" Width="11%" align="center">開(kāi)始時(shí)間</th>
## JS ##
按照官放文檔設(shè)置

$(function(){

 $('#setStartDate').datebox('setValue', '2017-11-11');

});

報(bào)錯(cuò)

Uncaught TypeError: Cannot read property 'options' of undefined


跪求解決,謝謝

回答
編輯回答
凹凸曼

使用EasyUI之前必須先聲明UI控件,有兩個(gè)方法聲明它。

  • 直接在 HTML 聲明組件。
<input id="cc" style="width:200px" />
    <div class="easyui-dialog" style="width:400px;height:200px"
        data-options="title:'My Dialog',collapsible:true,iconCls:'icon-ok',onOpen:function(){}">
            dialog content.
    </div>
  • 編寫(xiě) JavaScript 代碼來(lái)創(chuàng)建組件。
    $('#cc').combobox({
        url: ...,
        required: true,
        valueField: 'id',
        textField: 'text'
    });

顯然,樓主采用的是兩者中的一部分,如果想用js聲明的話(huà),就在js里面設(shè)置options,如果要用標(biāo)簽聲明的話(huà),那就給標(biāo)簽加上對(duì)應(yīng)的class

2018年8月13日 20:17
編輯回答
耍太極

請(qǐng)問(wèn)樓主解決了么,我也是遇到這個(gè)問(wèn)題

2018年8月23日 21:45
編輯回答
夕顏
<input id="setStartDate" class="easyui-datebox">
<script>
    $(function(){
        $('#setStartDate').datebox('setValue', '2017-11-11');
    });
</script>
2017年5月21日 10:14