LoginSignup
2
2

More than 5 years have passed since last update.

jqGridのフォーム入力で日付ピッカーを使う方法

Posted at

モーダルダイアログフォームでjQuery-UIのDatepickerを使う

tableを直接編集する場合のカレンダーピッカー使用方法はググれば直ぐ見つかるのですが、
モーダルダイアログフォームでDatepicker使う場合は、一手間必要みたいです。

以下の方法で実装できました。

$("#TABLE").jqGrid(

    //....中略....

    ,afterShowForm:function(){
        // 入力フォーム表示直後のイベントハンドラ
        // カレンダーピッカー生成
        $("#DATE_FIELD").datepicker({dateFormat:"yy/mm/dd"});
    }

);

モーダルダイアログが動的生成になるので、フォーム生成直後にDatepickerUIを生成してやります。

参考

jqGrid に jQuery Datepicker(カレンダー)を表示するサンプル

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2