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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:43:01+00:00 2026-05-25T15:43:01+00:00

I want to add about 150 element from a xml file to a select

  • 0

I want to add about 150 element from a xml file to a select control that is inside a jqGrid cell. I was thinking of doing this in two ways:

1.Using the editoptions value:

{ name: 'language', width: 100, sortable: false, editable: true, edittype: 'select', editoptions: { value: languageElem()} }

using data received from the method:

function languageElem() {
$.ajax({
    type: 'POST',
    contentType: "application/json; charset=utf-8",
    url: 'jqService.asmx/GetLanguages',
    data: {},
    dataType: "json",
    success: function (data) {
        alert("success");
    }
});}

But I’m having trouble forwarding the data from the ajax part.

2.Simply accessing the select control inside the jqGrid cell and manually adding the options whenever the edit button is pressed.

The problem over here is that I have no idea how to access the control itself.

The code I used over here is:

function startEdit() {
if (selRow > -1) {
    $.ajax({
        type: 'POST',
        contentType: "application/json; charset=utf-8",
        url: 'jqService.asmx/GetLanguages',
        data: {},
        dataType: "json",
        success: function (data) {
            var cell = jQuery("#MainContent_list").getCell(selRow, "language");
            cell.options.length = 0;
            for (var i=0;i<data.d.length;i++)
            {
            }
        }
    });
    jQuery("#MainContent_list").jqGrid('restoreRow', selRow);
    jQuery("#MainContent_list").jqGrid('editRow', selRow);
}

My questions are:

1.Related to the first idea, what should I do to fix the method so that the control will receive it’s needed values?

2.Related to the second idea, how could I access the control inside the row?

Thanks, Catalin

  • 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-05-25T15:43:02+00:00Added an answer on May 25, 2026 at 3:43 pm

    Instead of value property (editoptions: { value: languageElem()}) you should use dataUrl and buildSelect (see the documentation). Because it’s difficult to return from ASMX HTML fragment <select><option>...</option></select> you can provide the list serialized as JSON and convert the server response to HTML fragment using buildSelect. In the answer and in this one you will find additional information. If you would search for dataUrl and buildSelect you will find more information and code example which you could use.

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

Sidebar

Related Questions

I have about 60 servers that I want to add as Registered servers for
I just basically want to add about 20 and sometimes 80 Proximity Alerts with
i have a table with about 200,000 records. i want to add a field
it's about Ruby On Rails. I want to use Googleauth and need to add
I have a list of string values that I want add to a hashtable
I have numbers in javascript from 01(int) to 09(int) and I want add 1(int)
I am creating an application where I want to add metadata about table fields
How are you ? I want to add block in site about time now
I want to add the field bio to about section of the document.
I want to add QSplashScreen to PyQT4 application. It works fine from Python, but

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.