jqGrid in Form Editing + jQuery UI Spinner results in data not being posted

jqGrid in Form Editing + jQuery UI Spinner results in data not being posted

Hello everyone.  This one may be a bug of jqGrid, but I should check wit the community first.

To expand on this thread's title, I have a jqGrid, filled via Ajax.  One of the columns is currency data (dollar amounts) and I would like this value to be edited via the jQuery UI spinner control.  The jqGrid control is set to Form Editing, so as per its documentation I use dataInit of editoptions to run a function that applies the spinner to the standard textbox.  Something like this:

  • //This is one entry of the colModel array:
    1. { name: 'AverageOverride', width: 80, editable: true, align: 'right', edittype: 'text', editoptions: { NullIfEmpty: true, dataInit: AvgOverrideSpinner } }
    2. ...

    3. //Where AvgOverrideSpinner is this function:
    4. function AvgOverrideSpinner(elem)
    5. {
    6.     $(elem).spinner(
    7.         {
    8.             culture: 'en-US'
    9.             , min: 0
    10.             , step: 0.01
    11.             , numberFormat: 'C'
    12.         });
    13. }

    Yes, I am using jQuery.globalize to support the currency format in the spinner.  The spinner itself appears and works properly, but the bottom issue here is that the posted form's data doesn't include data for AverageOverride.  On the other hand, if I DON'T use a spinner and simply leave a textbox in place, then the posted form's data DOES contain data for AverageOverride.  I can easily verify this using the onclickSubmit event in the client side, or in the server side (ASP.net MVC 4) by examining the contents of the form.

    Soooo, what do I need?  Well, I need resolution.  I want to use the spinner AND have its value posted.  Am I doing things right here?  Is this a known bug, perhaps?

    If this were a bug indeed, I am planning on using the change event of the spinner control to set a global JavaScript variable with the spinner's value so it can be picked up by the onclickSubmit event and added to the rest of the data, that is unless you fine fellows can come up with a better solution.

    Thanks a lot in advance.