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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:24:35+00:00 2026-06-16T23:24:35+00:00

I am developing a web application using JSP & Servlet (IDE: Eclipse, Database: Oracle10).

  • 0

I am developing a web application using JSP & Servlet (IDE: Eclipse, Database: Oracle10).

I am using JQGRID to display data in tabular format. I also want functionality of Add, Edit, Delete in JQGRID. So far I have completed Edit,Delete Functionality.

Now I want Add functionality, the problem is that when I click on default Add button then it is showing me only DESCRIPTION field which is set editable:true and not showing other two fields which are not editable. I have not set them editable because they are primary keys, and I don’t want them to be edited.

So my question is is there any way that I can set not editable columns to Editable after user clicks on Add.

Following is my source code:

jQuery("#list10_d2").jqGrid({
                height: "100%",
                url:'ProtocolJGridServChildStages?q=2&action=protStages',
                datatype: "xml",
                 colNames:['Sr. No.','PROTOCOL_ID',  'STAGE_ID',  'DESCRIPTION'],
                 colModel:[{name:'srNo',index:'srNo', width:35,sortable:true},
                           {name:'PROTOCOL_ID',index:'PROTOCOL_ID', width:100,sortable:false},
                           {name:'STAGE_ID',index:'STAGE_ID', width:100,sortable:false},
                           {name:'DESCRIPTION',index:'DESCRIPTION', width:150,sortable:false,editable:true}
                           ],
                rowNum:5,
                rowList:[2,4,10],
                pager: '#pager10_d2',
                sortname: 'PROTOCOL_ID',
                viewrecords: true,
                sortorder: "asc",
                multiselect: true,
                editurl: "ProtocolJGridServChildStages?action=protocolStageEdit",
                caption:"CRM_PROT_STAGES",
                onSelectRow: function(ids)
                {
                    if(ids && ids!==lastsel)
                    {               
                        var ret = jQuery("#list10_d2").jqGrid('getRowData',ids);
                        protID = ret.PROTOCOL_ID;
                        stageID = ret.STAGE_ID;

                        jQuery("#list10_d2").jqGrid('setGridParam',{editurl:'ProtocolJGridServChildStages?action=protocolStageEdit&protID='+protID+'&stageID='+stageID});
                        jQuery('#list10_d2').jqGrid('restoreRow',lastsel);
                        jQuery('#list10_d2').jqGrid('editRow',ids,true);
                        lastsel=ids;
                    }
                }
            }).navGrid('#pager10_d2',{add:true,edit:true,del:true},{width:400,height:200},{width:500,mtype:'POST', url: 'ProtocolJGridServChildStages', addData:{action:'protocolStageAdd',protID: function () {return protID;}, stageID: function(){return stageID;}}, closeOnSubmit: true},{mtype: 'POST',url: 'ProtocolJGridServChildStages',delData: {action: 'protocolStageDelete',protID: function () {return protID;}, stageID: function(){return stageID;}}});
            jQuery("#ms1").click( function() {
                var s;
                s = jQuery("#list10_d2").jqGrid('getGridParam','selarrrow');
                alert(s);
            }).navGrid('#page',{edit:true,add:true,del:true});

Thanks in advance…

Edit:

.navGrid('#pager10_d2',{add:true,edit:true,del:true},{width:400,height:200},{width:500,mtype:'POST', url: 'ProtocolJGridServChildStages',beforeShowForm: function(){var cm = $('#list10_d2').jqGrid('getColProp',"PROTOCOL_ID");  cm.editable=true; cm = $('#list10_d2').jqGrid('getColProp',"STAGE_ID");  cm.editable=true; alert("before");}, addData:{action:'protocolStageAdd',protID: function () {return protID;}, stageID: function(){return stageID;}}, closeOnSubmit: true},{mtype: 'POST',url: 'ProtocolJGridServChildStages',delData: {action: 'protocolStageDelete',protID: function () {return protID;}, stageID: function(){return stageID;}}});

EDIT

    }).navGrid('#pager10_d2',{add:true,edit:true,del:true},
                    {closeOnEscape:true, recreateForm: true, width:400,height:200},
                    {closeOnEscape:true, recreateForm: true, beforeShowForm: function(formId){var cm = $('#list10_d2').jqGrid('getColProp',"PROTOCOL_ID");  cm.editable=false; var cm2 = $('#list10_d2').jqGrid('getColProp',"STAGE_ID");  cm2.editable=true; alert("before");}, addData:{action:'protocolStageAdd',protID: function () {return protID;}, stageID: function(){return stageID;}},width:500,mtype:'POST', url: 'ProtocolJGridServChildStages',closeOnSubmit: true},
                    {closeOnEscape:true, recreateForm: true, mtype: 'POST',url: 'ProtocolJGridServChildStages',delData: {action: 'protocolStageDelete',protID: function () {return protID;}, stageID: function(){return stageID;}}});
  • 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-16T23:24:37+00:00Added an answer on June 16, 2026 at 11:24 pm

    Try this

    In beforeShowForm event

    add this code

    var cm = $('#list10_d2').jqGrid('getColProp',"PROTOCOL_ID");
    

    inside add option

      {   cm.editable=true;}
    

    inside add option

     {cm.editable=false; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I developing a web application using JSP & Servlet (IDE: Eclipse, Database: Oracle10). I
I am developing a web application using JSP & Servlet.(IDE: Eclipse, Container: Tomcat7.0) To
I am developing web application using JSP and Servlet (IDE: Eclipse, Container: Tomcat7.0, DB:
I am developing a web application. I am using Eclipse as IDE. I was
I am using eclipse Indigo IDE ..I am developing a jsp application ( myProject
I am developing a web application using JSP and Servlet. I am trying to
I'm developing a simple servlet/JSP, data-driven web site on Google App Engine. I've started
I am using Spring Web MVC and Hibernate for developing my application. My login.jsp
I am developing a dynamic JSP/Servlet web application. In order to handle the session,
I am developing a web application using Java/JSP. One class, say Student, has 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.