2012-08-01 773 views
0

出現問題。 以添加我的兩個字段和日期的形式。我連接到這些日期選擇器jqgrid +添加表單+日期選擇器

beforeShowForm: pickLedgerDates, 

function pickLedgerDates(){ 
    $("#payment_date,#invoice_date").datepicker(); 
} 
形式本身,當你點擊第一個字段

,有一個日曆,選擇一個日期,一切都很好。 當你點擊第二個字段polyavlyaetsya日曆時,選擇一個日期和放置在第一個字段中的日期,並在其上放置焦點。並且該窗口不關閉日曆。

回答

0

爲什麼不能你把日期選擇器,當你定義colModal

見例如

{ name: 'date',height:100, index: 'date', align: 'right',sortable:false, formatter: 'date', formatoptions: { newformat: 'd/m/y' }, editable: true,editrules:{required:true}, editoptions:{readonly: 'readonly', dataInit:function(el) { $(el).datepicker();}}},

與這兩個日期字段給這個,然後它應該工作。

+0

對不起。但是這不起作用。 – 2012-08-01 10:32:40

+0

我通過php array形成colModel + json_decode 有這個 「editoptions」:{「dataInit」:「function(el){setTimeout(\」$(el).datepicker(); \「,3000);}」} – 2012-08-01 10:45:36

相關問題