0
當我在網格中寫入日期字段時,不會顯示我的網格日期字段。即使網格也不顯示如何在jqgrid中添加日期選擇器
colModel:[
{name:'id',index:'id', width:55, editable:false,editrules:{required:true},searchoptions:{sopt: ['eq', 'ne']}},
{name:'employe',index:'employe', width:100,editable:true,formoptions:{rowpos:2,elmprefix:" "},editrules:{required:true}},
{name:'gender',index:'gender', width:55,editable: true, formatter: 'dynamicText', width: 150, edittype: 'custom', editoptions: { custom_element: radioelem, custom_value: radiovalue},formoptions:{rowpos:4,elmprefix:" "}},
{name:'role',index:'role', width:100,editable:true,edittype:"select",
editoptions:{dataUrl:'test.txt', defaultValue:'Intime'},
formoptions:{rowpos:3,elmprefix:" " }},
{name:'department',index:'department', width:80, align:"right",editable:true,edittype:"select",
editoptions:{dataUrl:'test.txt', defaultValue:'Intime'},
formoptions:{rowpos:5,elmprefix:" " }},
{name:'joinedate',index:'joinedate', width:80,
editable:true,
editoptions:{size:12,
dataInit:function(el){
$(el).datepicker({dateFormat:'yy-mm-dd '});
},
defaultValue: function(){
var currentTime = new Date();
var month = parseInt(currentTime.getMonth() + 1);
month = month <= 9 ? "0"+month : month;
var day = currentTime.getDate();
day = day <= 9 ? "0"+day : day;
var year = currentTime.getFullYear();
return year+"-"+month + "-"+day;
}
},
formoptions:{ rowpos:6,elmsuffix:" yyyy-mm-dd", elmprefix:" "},
editrules:{required:true}
}
這是我的代碼..在網格日期字段不顯示請幫助我。
@ user2940331:什麼是不工作?我無法驗證'dateFormat'是否對應您使用的日期格式。你能看到datepicker嗎?您使用哪種編輯模式(不編輯表單)?你寫了「當我在網格中寫入日期字段時不顯示日期字段」。 **保存**數據有問題嗎? – Oleg
@ user2940331:如果您再次使用「緊急」一詞,我將不再針對您的問題撰寫答案。我和其他人試圖幫助你有*他自己的工作*。我們試圖通過消費所有者私人時間來幫助您。快點起來我們至少是不合時宜的。 – Oleg
ohh我很抱歉 – papr