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 8962547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:09:03+00:00 2026-06-15T16:09:03+00:00

I have searched many forumns and posts and I still cannot get the edittype:

  • 0

I have searched many forumns and posts and I still cannot get the edittype: select with the editoptions: dataurl to work.

When the grid is populated the data loads loads just fine. When I click on the edit button the drop down lists have the correct values and names. When I click save I get an error stating that one of the parameters is missing. It doesn’t appear that it is pulling the value of the selected option.

I have tried the formatter: ‘select’ option but when I use that nothing shows up in those columns when the grid is loaded.

Here is what I have for code.

var buildSelectFromJson = function (data) {
    var html = '<select>', d = data.d, length = d.length, i = 0, item;
    for (; i < length; i++) {
        item = d[i];
        html += '<option value=' + item.id + '>' + item.value + '</option>';
    }
    html += '</select>';
    return html;
};

$.extend($.jgrid.edit, {
    ajaxEditOptions: { contentType: "application/json" },
    recreateForm: true,
    serializeEditData: function (postData) {
        return JSON.stringify(postData);
    }
});

jQuery("#usage").jqGrid({
    url: '/vochaptracker/Services/vochapService.asmx/GetUsage',
    datatype: 'json',
    mtype: 'post',
    loadonce: true,
    ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
    serializeGridData: function (postData) {
        return JSON.stringify(postData);
    },
    jsonReader: {
        root: function (obj) { return obj.d.rows; },
        page: function (obj) { return obj.d.page; },
        total: function (obj) { return obj.d.total; },
        records: function (obj) { return obj.d.records; }
    },
    colNames: ['Date', 'Paint', 'Booth', 'Gallons Used'],
    colModel: [
        { name: 'date', index: 'date', width: 75, editable: true },
        { name: 'paint', index: 'paint', width: 300, editable: true, edittype: 'select', formatter:'select', editoptions: { dataUrl: "/vochaptracker/Services/vochapService.asmx/GetPaintsForEdit",
            buildSelect: buildSelectFromJson}
        },
        { name: 'booth', index: 'booth', width: 100, editable: true, edittype: 'select', formatter:'select', editoptions: { dataUrl: "/vochaptracker/Services/vochapService.asmx/GetBoothsForEdit",
            buildSelect: buildSelectFromJson}},
        { name: 'gallonsUsed', index: 'gallonsUsed', width: 100, editable: true }
    ],
    rowNum: 20,
    rowList: [20, 30, 40],
    pager: '#pager4',
    sortname: 'ID',
    viewrecords: true,
    sortorder: "desc",
    caption: "Daily Usage",
    height: '400',
    editurl: '/vochaptracker/Services/vochapService.asmx/EditUsage',
    ajaxSelectOptions: { contentType: "application/json", dataType: 'json', type:  "POST" }
});
jQuery("#usage").jqGrid('navGrid', "#pager4", { edit: false, add: false, del: true });
jQuery("#usage").jqGrid('inlineNav', "#pager4");

Web Service:

public class jqGridPaintHelper
{
    public string total;
    public string page;
    public string records;
    public List<TableRow> rows;
}

public class TableRow
{
    public string id;
    public List<string> cell;
}

public class editHelper
{
    public string id;
    public string value;
}

    [WebMethod]
    [ScriptMethod( ResponseFormat = ResponseFormat.Json )]
    public jqGridPaintHelper GetUsage( int page, int rows, string sidx, string sord )
    {
        vochapdbDataContext db = new vochapdbDataContext();
        jqGridPaintHelper helper = new jqGridPaintHelper();
        int dbCount = db.DailyUsages.Count();
        helper.total = ( ( dbCount + rows - 1 ) / rows ).ToString();
        helper.page = page.ToString();
        helper.records = dbCount.ToString();

        List<TableRow> usage = new List<TableRow>( dbCount );
        foreach ( DailyUsage row in db.DailyUsages )
        {
            usage.Add( new TableRow()
            {
                id = row.ID.ToString(),
                cell = new List<string> {
                    row.date.ToShortDateString(),
                    row.Paint.paintName.ToString(),
                    row.Booth.tag.ToString(),
                    row.gallonsUsed.ToString()
                }
            } );
        }

        helper.rows = usage;

        return helper;
    }

    [WebMethod]
    [ScriptMethod( ResponseFormat = ResponseFormat.Json )]
    public int EditUsage( string ID, string date, string paintID, string boothID, string gallonsUsed, string oper, string id )
    {
        vochapdbDataContext db = new vochapdbDataContext();

        if ( oper == "edit" )
        {
            db.updateUsage( int.Parse( ID ), DateTime.Parse( date ), paintID, int.Parse( boothID ), decimal.Parse( gallonsUsed ) );
        }
        else if ( oper == "add" )
        {
            DailyUsage newUsage = new DailyUsage();
            newUsage.date = DateTime.Parse( date );
            newUsage.paintID = paintID;
            newUsage.boothID = int.Parse( paintID );
            newUsage.gallonsUsed = decimal.Parse( gallonsUsed );

            db.DailyUsages.InsertOnSubmit( newUsage );
            db.SubmitChanges();
        }
        else if ( oper == "del" )
        {
            db.deleteUsage( int.Parse( id ) );
        }

        return 1;
    }

    [WebMethod]
    [ScriptMethod( ResponseFormat = ResponseFormat.Json )]
    public List<editHelper> GetPaintsForEdit()
    {
        vochapdbDataContext db = new vochapdbDataContext();

        List<editHelper> paints = new List<editHelper>();

        foreach ( Paint row in db.Paints )
        {
            paints.Add( new editHelper() { id = row.ID, value = row.paintName } );
        }

        return paints;
    }

    [WebMethod]
    [ScriptMethod( ResponseFormat = ResponseFormat.Json )]
    public List<editHelper> GetBoothsForEdit()
    {
        vochapdbDataContext db = new vochapdbDataContext();

        List<editHelper> booths = new List<editHelper>();

        foreach ( Booth row in db.Booths )
        {
            booths.Add( new editHelper() { id = row.ID.ToString(), value = row.tag } );
        }

        return booths;
    }

This is the error I get when I try to save a row after editing:

System.InvalidOperationException: Missing parameter: paintID.
at System.Web.Services.Protocols.ValueCollectionParameterReader.Read(NameValueCollection collection)
at System.Web.Services.Protocols.HtmlFormParameterReader.Read(HttpRequest request)
at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()

Any help is greatly appreciated. I have been stuck for about a month now.

  • 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-15T16:09:05+00:00Added an answer on June 15, 2026 at 4:09 pm

    I finally figured it out. I had some weird values in my dropdown select list.

    I added ” around the values and it fixed the problem.

    Old:

    html += '<option value=' + item.id + '>' + item.value + '</option>';
    

    New:

    html += '<option value="' + item.id + '">' + item.value + '</option>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a newbie and have searched many posts and railscast tutorials and still cant
Yes, I have searched and tried many techniques, but nothing seems to work. Here
I have searched all morning and yesterday afternoon and still cannot find an solution
I have searched a bit upon it but can't get it to work properly.
Although I have searched for many information about Cocoa Bindings, I still remain relatively
I have searched, and searched, .. and searched. I have seen many posts here
First of all I have searched many times in this forum but none is
This is my fort post on stackoverflow. I have searched many similiar Q&A's on
I want to use bar chart in web application. I have searched many libraries
I have searched through many times but have not seen this before. Probably really

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.