How do I add datepicker in the add row dialog in jqGrid?

前端 未结 4 810
长发绾君心
长发绾君心 2021-02-05 16:24

Hi I\'m using jqGrid and I\'m wondering, how do I add jQueryUI\'s datepicker to some of the input fields when in the add row dialog?

Also how do I check if the input ent

4条回答
  •  一向
    一向 (楼主)
    2021-02-05 17:05

    To get the datepicker in the create/edit popup , you need to add this lines to the updateDialog or to the addDialog:

    afterShowForm: function (formId) {
        $("#CreationDate").datepicker();
    }
    

    If you want to format it, you can set format option in datepicker()..like:

    afterShowForm: function (formId) { $("#CreationDate").datepicker({
               dateFormat: "dd/M/yy"});}
    

提交回复
热议问题