var lastsel3;
mygrid = $("#list").jqGrid({
width: 800,
height: 450,
url: 'LoadActionSubmit/',
datatype: 'json',
mtype: 'POST',
pager: jQuery('#pager'),
rowNum: 20,
rowList: [20, 40, 60, 80],
sortname: 'Id',
sortorder: "desc",
viewrecords: true,
imgpath: '/scripts/themes/steel/images',
caption: '查询条件:',
recordtext: '条记录',
sortorder: "desc",
loadtext: 'loading....',
colNames: ['网吧名称', '活动日期', '活动开始时间', '活动结束时间', '包机数量', '活动费用', '删除'],
colModel: [{ name: 'netbarid', index: 'NETBARNAME', width: 160, align: 'center' },
{ name: 'barname', index: 'ACTIONDATE', width: 160, align: 'center', sorttype: "date" },
{ name: 'ACTIONBEGINTIME', index: 'ACTIONBEGINTIME', width: 160, align: 'center', editable: true },
{ name: 'ACTIONENDTIME', index: 'ACTIONENDTIME', width: 160, align: 'center', editable: true },
{ name: 'county', index: 'FLIGHTSNUMBER', width: 160, align: 'center' },
{ name: 'applicant', index: 'ACTIONFEES', width: 160, align: 'center' },
{ name: 'act', index: 'act', width: 160, align: 'center', sortable: false}],
loadComplete: function() {
// var sumrecords = $("#list").getGridParam("records");
// if (sumrecords != null) {
// $('#totalsum').text(sumrecords);
// }
var ids = jQuery("#list").getDataIDs();
for (var i = 0; i < ids.length; i++) {
var cl = ids[i];
se = "<input style='height:22px;width:40px;' type='button' value='删除' onclick=deleterow(); />";
$("#list").setRowData(cl, { act: se });
}
},
onSelectRow: function(id) {
if (id && id !== lastsel3) {
jQuery('#list').restoreRow(lastsel3);
jQuery('#list').editRow(id, true, pickdates);
lastsel3 = id;
}
}
})
});
function pickdates(id) {
alert("test");
// jQuery("#" + id + "_ACTIONBEGINTIME", "#list").datepicker({ dateFormat: "yy-mm-dd" });
jQuery("#" + id + "_ACTIONBEGINTIME", "#list").timeEntry({ spinnerImage: '/Script/jqtentry/spinnerDefault.png' });
jQuery("#" + id + "_ACTIONENDTIME", "#list").timeEntry({ spinnerImage: '/Script/jqtentry/spinnerDefault.png' });
// $('#actionendtime').timeEntry();
// $('#actionbegintime').val("12:13");
}
function deleterow() {
var gr = jQuery("#list").getGridParam('selrow');
//getSelectedRow();
if (gr != null)
$('#list').delGridRow(gr, { url: '/IRIS/Delete', delData: { Irisid: $('#list').getRowData(gr).Irisid} });
else alert("Please Select Row to delete!");
}