在我的 jqGrid 中,我想在我的网格中有空值......
相反,我得到 1/1/0001
我的 dateTime 模型类型都可以为空。
我错过了什么吗???
这是代码...
public DateTime? DischargeDateTime { get; set; }
大家有什么推荐的?
tableToGrid("#frTable", {
cmTemplate: { sortable: false },
caption: '@TempData["POPNAME"]' + ' Population',
height: '400',
gridview: true,
shrinkToFit: false,
autowidth: true,
colNames: ['Edit',
'MRN',
'Hospital Fin',
'First Name',
'Last Name',
'Date of birth',
'Completed Pathway',
'Completed Pathway Reason',
'PCP Appointment',
'Specialist Appointment',
'Admit Date',
'Discharge Date',
'Discharge Disposition',
'Discharge To',
'Discharge Advocate Call',
'Home Healthcare',
'Safe Landing Accepted',
'PCP Name',
'PCP Phone',
'PCP Appointment Location',
'Specialist Name',
'Specialist Phone',
'Specialist Appointment Location',
'Comments',
'Patient Room Phone',
'Phone',
'Payor',
'MRN Type'
],
colModel: [
{ name: 'Edit', width: 95, align: 'left' },
{ name: 'MRN', width: 125, align: 'left' },
{ name: 'Hospital_Fin', width: 145, align: 'left' },
{ name: 'First_Name', width: 115, align: 'left' },
{ name: 'Last_Name', width: 115, align: 'left' },
{ name: 'Date_of_birth', width: 145, align: 'left' },
{ name: 'Completed_Pathway', width: 125, align: 'left', editOptions: {value:"1:Yes;0:No"} },
{ name: 'Completed_Pathway_Reason', width: 165, align: 'left' },
{ name: 'PCP_Appointment', width: 115, align: 'left' },
{ name: 'Specialist_Appointment', width: 125, align: 'left' },
{ name: 'Admit_Date', width: 185, align: 'left' },
{ name: 'Discharge_Date', width: 185, align: 'left' },
{ name: 'Discharge_Disposition', width: 155, align: 'left' },
{ name: 'Discharge_To', width: 85, align: 'left' },
{ name: 'Discharge_Advocate_Call', width: 155, align: 'left' },
{ name: 'Home_Health_Care_Accepted', width: 105, align: 'left' },
{ name: 'Safe_Landing_Accepted', width: 165, align: 'left' },
{ name: 'PCP_Name', width: 85, align: 'left' },
{ name: 'PCP_Phone', width: 85, align: 'left' }, // formatter: formatPhoneNumber,
{ name: 'PCP_Appointment_Location', width: 185, align: 'left' },
{ name: 'Specialist_Name', width: 195, align: 'left' },
{ name: 'Specialist_Phone', width: 135, align: 'left' }, //, formatter: formatPhoneNumber
{ name: 'Specialist_Appointment_Location', width: 185, align: 'left' },
{ name: 'Comments', width: 185, align: 'left' },
{ name: 'Patient_Room_Phone', width: 135, align: 'left' }, //, formatter: formatPhoneNumber
{ name: 'Phone', width: 125, align: 'left' }, //, formatter: formatPhoneNumber
{ name: 'Payor', width: 155, align: 'left' },
{ name: 'MRN_Type', width: 135, align: 'left' }
]
});
我的数据库中确实有几个空值返回......不知道为什么这不起作用......
目前正在尝试 UIHint ...
@if (Model == null){
<text></text>
}else{
<text></text>
}
除了现在一切都显示不正确