我已经安装了 jqgrid,一切都很好,只是日期选择器没有出现在编辑表单上。我有它设置你,我双击一行打开编辑表单但日期选择器不显示?有任何想法吗?这是我的头部信息。
<link rel="stylesheet" type="text/css" media="screen" href="css/jquery-ui-1.10.3.custom.min.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/nhf.css" />
<style type="text/css">
html, body {
margin: 0;
padding: 0;
font-size: 95%;
}
</style>
<script src="js/jquery-1.9.0.min.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
我在萤火虫中收到“TypeError: $(...).datepicker is not a function”的警告。我做错了什么?谢谢
<script type="text/javascript">
$(function(){
$("#list").jqGrid({
url:'request.php',
datatype: 'xml',
mtype: 'GET',
height: 350,
colNames:['id','Project', 'Assigned To','Assign Date','Check Date','Due Date','Attachments'],
colModel :[
{name:'id', index:'id', width:20},
{name:'name', index:'name', width:200, align:'left',editable:true, editoptions:{
size:70} },
{name:'id_continent', index:'id_continent', width:80, align:'right',editable:true,edittype:'select',
editoptions:{value: "Henry:Henry; Ramon:Ramon; Paul:Paul" } },
{name:'lastvisit', index:'lastvisit', width:70, align:'right',formatter: 'date',srcformat:'yyyy-mm-dd',newformat: 'm-d-Y',editable:true, edittype: 'text', },
{name:'cdate', index:'cdate', width:80, align:'right',formatter: 'date',srcformat:'yyyy-mm-dd',newformat: 'm-d-Y', edittype: 'text',editable:true , editoptions: { dataInit: function(el) { setTimeout(function() { $(el).datepicker(); }, 200); } } },
{name:'ddate', index:'ddate', width:80, align:'right',formatter: 'date',srcformat:'yyyy-mm-dd',newformat: 'm-d-Y',date:'true',editable:true, edittype: 'text',},
{name:'email', index:'email', width:80,align:'center',sortable:false}
],
pager: '#pager',
rowNum:20,
rowList:[20,40,80],
sortname: 'id',
sortorder: 'desc',
viewrecords: true,
gridview: true,
caption: 'Pending Assignements',
ondblClickRow: function(rowid) {
jQuery(this).jqGrid('editGridRow', rowid,
{width:500,Height:400,recreateForm:true,closeAfterEdit:true,
closeOnEscape:true,reloadAfterSubmit:false});
}
}); });