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

  • Home
  • SEARCH
  • 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 7741623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:04:24+00:00 2026-06-01T09:04:24+00:00

i’m trying to use jQuery multiselect plugin in a form editing jqGrid (add form).

  • 0

i’m trying to use jQuery multiselect plugin in a form editing jqGrid (add form).

This is the code (colModel extract) I’m using to build the dropdown:

{ 
    name: 'CaratteristicheCamera',
    index: 'CaratteristicheCamera', 
    width: 50, 
    hidden: true, 
    edittype: 'select',
    editable: true, 
    editrules: { edithidden: true, required: true }, 
    editoptions: {
        multiselect: true,
        dataUrl: '<%# ResolveUrl("~/Service/Domain/ServiceRoom.asmx/GetRoomFeatureList") %>',
        buildSelect: function (data) {
            var retValue = $.parseJSON(data);
            var response = $.parseJSON(retValue.d);

            var s = '<select id="CaratteristicheCamera" name="CaratteristicheCamera">';

            if (response && response.length) {
                for (var i = 0, l = response.length; i < l; i++) {
                    s += '<option value="' + response[i]["Id"] + '">' +
                        response[i]["Descrizione"] + '</option>';
                }
            }

            return s + "</select>";
        },
        dataInit: function() {
            $("#CaratteristicheCamera").multiselect();
        }
    }

},

As you guys can see, jqGrid call webmethod placed in asmx file. Everything seems to work ok, but I can’t receive all the values user select from the dropdown. It seems that the system send to the server the last selection.
Do u have any tips on it?

EDIT: this is the asmx webservice declaration

[WebMethod]
public string SaveRoom(string id, string codice, string Numero, string NumeroPiano,
                       string Nome, string TipoCamera, string StatoCamera,
                       string CaratteristicheCamera, string TipoSdoppiabilita)
{}
  • 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-01T09:04:25+00:00Added an answer on June 1, 2026 at 9:04 am

    I tried Eric Hynds jQuery UI MultiSelect Widget together with jqGrid 3.4.1 and couldn’t see any problem which you described. I recommend you compare your demo with my to find the differences.

    One bad thing which I see in your code is that you set id="CaratteristicheCamera" attribute on the <select> which you generate in buildSelect. You should just use <select> without any additional attributes. The jqGrid will set itself all attributes like id or multiple="multiple".

    In the demo I used editurl: 'test.asmx/dummy' which not exist on the server. So one sees the error message like

    enter image description here

    after choosing and submitting the selected items

    enter image description here

    Nevertheless one can see with respect of tools like Fiddler, Firebug or Developer Tools of IE or Chrome (see HTTP traffic in “Network” tab) that the demo post the data like

    {"name":"test8","closed":"No","ship_via":"FE,TN","oper":"edit","id":"8"}
    

    to the http://www.ok-soft-gmbh.com/jqGrid/test.asmx/dummy. So the values "FE,TN" of selected items FedEx, TNT will be send as expected. In your case the CaratteristicheCamera parameter of SaveRoom should be initialized to the comma separated list of selected values. I hope you will find the problem in your code if you compare my demo with youth.

    Another small problem in the code which you posted is that you make serialization to JSON manually in the WebMethod GetRoomFeatureList and returns string. So the string will be serialized to JSON twice. So you use

    var retValue = $.parseJSON(data);
    var response = $.parseJSON(retValue.d);
    

    Correct will be to return something like List<Room>. ASP.NET will serialize it automatically. If you would use the jqGrid option

    ajaxSelectOptions: {
        contentType: 'application/json; charset=utf-8',
        dataType: "json"
    }
    

    the data in buildSelect will be not needed to parsed at all. You can directly use data.d[i].Id and data.d[i].Descrizione in the loop. I wrone you about the same problem in another answer on your old question.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.