Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8139109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:42:59+00:00 2026-06-06T11:42:59+00:00

I have my jQuery code like this $(document).ready(function () { var lastsel; $(‘#jqgProducts’).jqGrid({ //url

  • 0

I have my jQuery code like this

$(document).ready(function () {

         var lastsel;

    $('#jqgProducts').jqGrid({
             //url from wich data should be requested
             url: '@Url.Action("CompOff")',
         //type of data
         datatype: 'json',
         //url access method type

         mtype: 'POST',
         //columns names

         ondblClickRow: function (id) {
             if (id && id !== lastsel) {
                 jQuery('#list').restoreRow(lastsel);
                 jQuery('#list').editRow(id, true);
                 lastsel = id;
             }
             $('#jqgProducts').editRow(id, true,null, null);
         },

         editurl: '@Url.Action("CompOffEdit")',
         colNames: ['IdNr', 'CompOffDate', 'Description', 'ExpiryDate', 'IsApproved', 'AppliedOn'],
         //columns model
         colModel: [
                    { name: 'Id', index: 'Id', align: 'center', editable: true, hidden: true},
                        { name: 'CompOffDate', index: 'CompOffDate', align: 'center', formatter: 'date', formatoptions: { newformat: 'd/m/Y' }, editable: true },
                          { name: 'Description', index: 'Description', align: 'center', editable: true, editoptions: { maxlength: 200} },
                        { name: 'ExpiryDate', index: 'ExpiryDate', align: 'center', formatter: 'date', formatoptions: { newformat: 'd/m/Y' }, editable: false },
                        { name: 'IsApproved', index: 'IsApproved', align: 'center', editable: false },

                        { name: 'AppliedOn', index: 'AppliedOn', align: 'center', formatter: 'date', formatoptions: { newformat: 'd/m/Y' }, editable: false }

                      ],
         //pager for grid
         pager: $('#jqgpProducts'),
         //number of rows per page
         rowNum: 10,
         //initial sorting column
         sortname: 'CompOffDate',
         //initial sorting direction
         sortorder: 'asc',
         //we want to display total records count
         viewrecords: true,

         caption: 'Comp Off Details',
         //grid height
         height: '100%',

         jsonReader: {
             root: "rows",
             page: "page",
             total: "total",
             records: "records",
             repeatitems: false,
             cell: "cell",
             id: "id",
             userdata: "userdata"
         }
     });

});

my controller like this

   public ActionResult CompOffEdit(int Id,DateTime CompOffDate, string Description)
    {
        RegisterCompOff r = db.RegisterCompOffs.Where(l=>l.Id==Id).SingleOrDefault();
        if (!(r == null))
        {
            r.CompOffDate = CompOffDate;
            r.Description = Description;
            db.Entry(r).State = EntityState.Modified;
            db.SaveChanges();
            return Content("true");
        }
        else
        {
            return Content("false");
        }

    }

when i’m trying to save the edits to db..i get this exception


The parameters dictionary contains a null entry for parameter 'idnr' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult CompOffEdit(Int32, System.DateTime, System.String)' in 'AGS.Hrms.Controllers.CompOffController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter. Parameter name: parameters

user can only edit compoff date and description here…and my id field which i’m picking from database is hidden.

can someone help me to rectify this problem

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T11:43:00+00:00Added an answer on June 6, 2026 at 11:43 am

    You should rename idnr parameter of the CompOffEdit action to id or you should rename the default id name of the parameter sending to the server during the row editing to idnr. You can use prmNames: {id: "idnr"} option of jqGrid for this.

    In the same way you should rename compOff parameter of CompOffEdit action to CompOffDate and reason to Description. Alternatively you can use some class instance, which has CompOffDate and Description as properties, as the parameter of CompOffEdit action. In the case the CompOffDate and Description properties will be initialized with the values from the editing row.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this jQuery code: $(document).ready(function() { $.ajax({ url: pages/+page+.php, cache: false }).done(function( html
I have this code : $(document).ready(function() { $('.DOFFDelete').click(function() { var id = $(this).attr(id); $.post(/Customer/DayOffDelete,
I have some jquery code inserting a div like this function popUpBox(){ $(.openBox).click(function(){ var
I have code like this: $(document).ready(function() { $(div #covert, div #coverb).height($(window).height() / 2 +
I have a setup like this... $(document).ready(function(){ var model = { /* some variable
I have some jQuery code like this : $(function($) { $('input.autonumeric').autoNumeric({aSep: ',', aDec: '.',vMax:'1000000000000'});
Right now my code looks like this: <script type=text/javascript> $(document).ready(function() { $.ajaxSetup({ cache: false
I have this: jQuery(document).ready(function(){ jQuery('a.color2030').click( function() { jQuery('tbody').hide(); jQuery('tbody.color2030').show(); }); jQuery('a.color2031').click( function() { jQuery('tbody').hide();
Let's assume that we have simple jQuery code like the following: var $document =
I have a problem with this Jquery function. The the simplifide code looks like:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.