Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Thanks for your answer... it worked i have placed an if else in the button click to check if its a first click or subsequent clicks and then it worked... but when i call reloadgrid i still see the same old parmaeters are passed to the controller.. ther are textboxes and dropdowns whose values changes and then i click the submit button which reloads the grid.. i m using <strong>postData</strong> parameter to pass additional values to the controller</p> <pre><code> &lt;script type="text/javascript"&gt; var firstClick = true; $(document).ready(function () { $("#StartDate").datepicker({ changeMonth: false, changeYear: false }); $("#EndDate").datepicker(); var updateDialog = { url: '&lt;%= Url.Action("UpdateGrid", "TouchSchedule") %&gt;' , closeAfterAdd: true , closeAfterEdit: true }; $('#btnSubmit').click(function () { $("#list").clearGridData(); if (!firstClick) { alert($('#ListFacility').val()); $("#list").trigger("reloadGrid"); } else { firstClick = false; /* Refreshes the grid */ $("#list").jqGrid({ url: '&lt;%= Url.Action("GetScheduleInfo", "TouchSchedule") %&gt;', datatype: 'json', mtype: 'GET', postData: { StartDate: $('#StartDate').val(), EndDate: $('#EndDate').val(), siteId: $('#ListFacility') ? $('#ListFacility').val() : -1 }, colNames: ['SiteID', 'Cal Date', 'Store Open', 'Start Time', 'End Time', 'MileageLimit AM', 'MileageLimit PM', 'TouchLimit PM', 'TouchLimit AM', 'Total Touches', 'Total Mileage', 'WeekDay'], colModel: [ { name: 'SiteID', index: 'SiteID', width: 40, align: 'left', /* key: true,*/editable: false, editrules: { edithidden: false }, hidedlg: true, hidden: false }, { name: 'CalDate', index: 'CalDate', width: 100, align: 'left', formatter: 'date', datefmt: 'm/d/Y', editable: true, edittype: 'text', editrules: { required: true, date: true }, formoptions: { elmsuffix: ' *'} }, { name: 'StoreOpen', index: 'StoreOpen', width: 40, align: 'left', editable: true, edittype: 'select', formatter: 'select', editrules: { required: true }, formoptions: { elmsuffix: ' *' }, editoptions: { value: { o: 'Open', c: 'closed'}} }, { name: 'StartTime', index: 'StartTime', width: 100, align: 'left', editable: true, formatter: 'date', masks: 'ShortTime', edittype: 'text', editrules: { time: true, required: true }, formoptions: { elmsuffix: ' *'} }, { name: 'EndTime', index: 'EndTime', width: 100, align: 'left', editable: true, edittype: 'text', editrules: { time: true, required: true }, formoptions: { elmsuffix: ' *'} }, { name: 'MileageLimitAM', index: 'MileageLimitAM', width: 50, align: 'left', editable: true, edittype: 'text', editrules: { custom: true, custom_func: CheckMileageLimit, required: true }, formoptions: { elmsuffix: ' *'} }, { name: 'MileageLimitPM', index: 'MileageLimitPM', width: 50, align: 'left', editable: true, edittype: 'text', editrules: { required: true }, formoptions: { elmsuffix: ' *'} }, { name: 'TouchLimitAM', index: 'TouchLimitAM', width: 50, align: 'left', editable: true, edittype: 'text', editrules: { required: true }, formoptions: { elmsuffix: ' *'} }, { name: 'TouchLimitPM', index: 'TouchLimitPM', width: 50, align: 'left', editable: true, edittype: 'text', editrules: { required: true }, formoptions: { elmsuffix: ' *'} }, { name: 'TotalTouches', index: 'TotalTouches', width: 50, align: 'left', editable: true, edittype: 'text', editrules: { required: true }, formoptions: { elmsuffix: ' *'} }, { name: 'TotalMileage', index: 'TotalMileage', width: 50, align: 'left', editable: true, edittype: 'text', editrules: { required: true }, formoptions: { elmsuffix: ' *'} }, { name: 'WeekDay', index: 'WeekDay', width: 200, align: 'left', editable: false, hidden: false}], pager: $('#listPager'), rowNum: 10, rowList: [10, 20, 30], sortname: 'CalDate', sortorder: "desc", viewrecords: true, caption: 'Schedule Calendar', autowidth: false, afterInsertRow: function (rowid, rowdata) { if (rowdata.IsWeekend) $(this).jqGrid('setRowData', rowid, false, { color: 'blue' }); } }).navGrid('#listPager', { edit: true, add: false, del: false, search: false, refresh: true } ); } }); }); function CheckMileageLimit(value, colname) { alert($("#TotalMileage").val()); if (value &gt; $("#TotalMileage").val()) { alert(false); return ["false", "value shuld be less"]; } else { alert(true); return ["true",""];} } &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload