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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:58:31+00:00 2026-05-20T02:58:31+00:00

I have the following problem: Inside a jqGrid there is a dropdownlist with option

  • 0

I have the following problem:

Inside a jqGrid there is a dropdownlist with option dataUrl to fetch data from a server.
If I click on form edit (or add) the dropdown is OK, but I need to disable it if the row is already existing. I saw that by using afterShowForm events, it works only when the dropdown is already populated (after the first time). The first time, it seems that afterShowForm is fired before the dropdown is populated by dataUrl.

How can I solve this issue?

  • 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-20T02:58:31+00:00Added an answer on May 20, 2026 at 2:58 am

    It seems to me that the most simplest way to disable dropdown would be to use buildSelect event in the editoptions additionally to the the dataUrl. If the data returned by dataUrl has already correct
    form the buildSelect can just return the input parameter back, but one can additionally disable the

    You should also use recreateForm:true for the form to be sure that all callback will be always called. The code schema can be about the following:

    var needDisable=true;
    $("#list").jqGrid({
        colModel:[
            {name:'myDropDown',editable: true,edittype:"select",
             editoptions:{dataUrl:'myDropDown.txt',
                          buildSelect: function(data) {
                              var field_id=this.id; // "myDropDown"
                              setTimeout(function(){
                                  if (needDisable) {
                                      $('#tr_'+field_id).attr('disabled','disabled');
                                  } else {
                                      $('#tr_'+field_id).removeAttr('disabled');
                                  }
                              }, 100);
                              return data;
                          }
            },
            // ... other colModel columns
        ],
        // ... other jqGrid parameters
    }).jqGrid('navGrid','#pager',{},
              { // Edit form parameters
                  recreateForm:true,
                  beforeShowForm:function(form){
                      needDisable=true;
                  }
              },
              { // Add form parameters
                  recreateForm:true,
                  beforeShowForm:function(form){
                      needDisable=false;
                  }
              });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem in ASP.NET: there is a form that contains a
I have following problem: I have a TabActivity which works well. Inside, there is
I have following UI hierarchy Scroll View -->TableLayout-->Rows [each row has TextView+EditText] Problem Inside
I have the following problem, from c++ I send huge string[] to java. huge
I have the following problem and I need to know if there´s a way
I've got the following problem: I have rhtml (html minced together with ruby inside
I have the following problem: I have to store in the database the data
I have the following problem: I have a JTable inside a JScrollPane, and the
I have the following problem spanning dynamically added rows to a TableLayout inside a
I'm writing a firefox extension and have the following problem: I added inside a

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.