<link rel="Stylesheet" type="text/css" media="screen" href="Themes/redmond/jquery-ui.css" />
<link rel="Stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" />
<link rel="stylesheet" href="css/jdpicker.css" type="text/css"/>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/jquery.json-2.4.js"></script>
<script type="text/javascript" src="js/grid.locale-en.js"></script>
<script type="text/javascript" src="js/jquery.jqGrid.min.js"></script>
<script type="text/javascript" src="js/jquery.jqGrid.src.js"></script>
<%-- <script type="text/javascript" src="js/jquery.summaryjqGrid.min.js"></script>--%>
<script type="text/javascript" src="js/jquery-ui-1.8.4.custom.min.js"></script>
<script type="text/javascript" src="js/jquery.jdpicker.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#go").click(function () {
$("#gridId").GridUnload();
gridload();
});
});
function gridload() {
$.ajax({
url: 'Uploading111.aspx/MyMethod?fromdate=' + $("#fromdate").val() + '&todate=' + $("#todate").val(),
dataType: 'json',
contentType: "application/json; charset=utf-8",
type: 'POST',
success: function (ReportDataNew, textStatus, XMLHttpRequest) {
gridData = JSON.parse(ReportDataNew.d);
$("#gridId").jqGrid({
data: gridData,
datatype: "local",
height: '100%',
hidegrid:true,
rowNum: 20,
colNames: ['UserName','WWID', 'DepName', 'MailId', 'CostCenter', 'Batch','Groups','MonthlyQuota', 'Authcode', 'Extension','Mobile', 'Landline','CampusCode','Generic','Mac'],
colModel: [
{ name: 'UserName', index: 'UserName', key: true, width: '200', editable: true,sortable: true, align: 'center' },
{ name: 'WWID', index: 'WWID', width: '250' , editable: true, sortable: true,sorttype:'int', align: 'center' },
{ name: 'DepName', index: 'depName', width:'200', editable: true, sortable: true,sorttype:'text', align: 'center' },
{ name: 'MailId', index: 'MailId', width:'400', editable: true, sortable: true,sorttype:'text', align: 'center' },
{ name: 'CostCenter', index: 'Costcenter', width:'200', editable: true, sortable: true,sorttype:'int', align: 'center' },
{ name: 'Batch', index: 'Batch', width:'200', editable: true, sortable: true,sorttype:'text', align: 'center' },
{ name: 'Groups', index: 'Groups', width:'200', editable: true, sortable: true,sorttype:'text', align: 'center' },
{ name: 'MonthlyQuota', index: 'MonthlyQuota', width:'250', editable: true,sortable: true,sorttype:'text', align: 'center' },
{ name: 'Authcode', index: 'Authcode', width:'200', editable: true, sortable: true,sorttype:'int', align: 'center' },
{ name: 'Extension', index: 'Extension', width:'200', editable: true, sortable: true,sorttype:'int', align: 'center' },
{ name: 'Mobile', index: 'Mobile', width:'300', editable: true, sortable: true,sorttype:'int', align: 'center' },
{ name: 'Landline', index: 'Landline', width:'300', editable: true, sortable: true,sorttype:'int', align: 'center' },
{ name: 'Businessunit', index: 'Businessunit', width:'300', editable: true,sortable: true,sorttype:'text', align: 'center' },
{ name: 'Generic', index: 'generic', width:'200', editable: true, sortable: true,sorttype:'text', align: 'center' },
{ name: 'Mac', index: 'mac', width:'200', editable: true, sortable: true,sorttype:'int', align: 'center' },
],
pager: '#gridpager',
viewrecords: true,
toppager: true,
loadtext: 'Loading...',
});
jQuery("#gridId").jqGrid('navGrid', '#gridpager',
{ edit: true, add: true, del: true, search: true, excel: true, exceltext: 'Excel', cloneToTop: true },
{ url: "Uploading.ashx", closeAfterEdit: true,afterSubmitCell: function () { $('#gridId').trigger('reloadGrid');}},
{ url: "Uploading.ashx", closeAfterAdd: true },
{ url: "Uploading.ashx", closeAfterDel: true },
{ closeAfterSearch: true, closeOnEscape: true, multipleSearch: false });
$("#gridId").jqGrid('navButtonAdd', '#gridpager', { caption: "Columns", title: "Reorder Columns", onClickButton: function () { $("#gridId").jqGrid('columnChooser',{shrinkToFit:false,autowidth: true}); } });
$("#gridId").jqGrid('gridResize', { minWidth: 250, maxWidth: 1800, minHeight: 80, maxHeight: 1350 });
jQuery("#gridId").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: "eq" });
jQuery("#gridId").jqGrid('navButtonAdd', '#gridpager', { caption: "Filter", title: "Toggle Searching Toolbar", buttonicon: 'ui-icon-pin-s', onClickButton: function () { $("#gridId")[0].toggleToolbar(); } });
jQuery("#gridId")[0].toggleToolbar();
},
error: function (xhr, ajaxOptions, thrownError) { alert('statusCode=Error: ' + xhr.status + '&status=Description :' + thrownError); }
});
}