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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:58:17+00:00 2026-06-18T18:58:17+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 records in tabular format.

code snippet:

jQuery("#list10").jqGrid({
        url:'ProfileServ?action=profile',
        datatype: "xml",
        sortable: true,
        height: 250,
        width: 550,
        colNames:['Sr.No.','PROFILE_ID','PROFILE_NAME','TITLE','FIRST_NAME','MIDDLE_NAME','LAST_NAME'], 
        colModel:[{name:'srNo',index:'srNo', width:20,sortable:true, hidden:true},
                          {name:'PROFILE_ID',index:'PROFILE_ID', width:70,sortable:true,editable:true},
                          {name:'PROFILE_NAME',index:'PROFILE_NAME', width:150,sortable:true,editable:true},
                          {name:'TITLE',index:'TITLE', width:200,sortable:false,editable:true, hidden:true},
                          {name:'FIRST_NAME',index:'FIRST_NAME', width:200,sortable:false,editable:true, hidden:true},
                          {name:'MIDDLE_NAME',index:'MIDDLE_NAME', width:200,sortable:false,editable:true, hidden:true},
                          {name:'LAST_NAME',index:'LAST_NAME', width:200,sortable:false,editable:true, hidden:true}],
        rowNum:10,
        rowList:[10,20,50,100],
        pager: '#pager10',
        sortname: 'srNo',
        loadonce:true,
        ignoreCase: true,
        viewrecords: true,
        sortorder: "desc",
        multiselect: false,
        editurl: "ProfileServ?action=profileEdit",
        caption: "Profile",
        }).navGrid('#pager10',{edit:true,add:true,del:true,view:true},
            {modal:true,checkOnUpdate:true,closeOnEscape:true,width:500,closeOnSubmit: true,editurl:'ProfileServ?action=profileEdit',
                beforeShowForm: function(formid){alert('hiu');
                    cm = $('#list10').jqGrid('getColProp',"PROFILE_NAME"); cm.hidden=true;
                    cm = $('#list10').jqGrid('getColProp',"TITLE"); cm.hidden=false;
                    cm = $('#list10').jqGrid('getColProp',"FIRST_NAME"); cm.hidden=false;
                    cm = $('#list10').jqGrid('getColProp',"MIDDLE_NAME"); cm.hidden=false;
                    cm = $('#list10').jqGrid('getColProp',"LAST_NAME"); cm.hidden=false;},recreateForm: true},
            {modal:true,closeOnEscape:true,recreateForm: true,width:500,mtype:'POST', url: 'ProfileServ',editData:{action: 'profileAdd',profileID: function () {return profileID;}},
                beforeShowForm: function(formid){alert('hi');
                    cm = $('#list10').jqGrid('getColProp',"PROFILE_NAME"); cm.hidden=true;
                    cm = $('#list10').jqGrid('getColProp',"PROFILE_ID"); cm.editable=true;
                    cm = $('#list10').jqGrid('getColProp',"TITLE"); cm.hidden=false;
                    cm = $('#list10').jqGrid('getColProp',"FIRST_NAME"); cm.hidden=false;
                    cm = $('#list10').jqGrid('getColProp',"MIDDLE_NAME"); cm.hidden=false;
                    cm = $('#list10').jqGrid('getColProp',"LAST_NAME"); cm.hidden=false;},recreateForm: true},
            {closeOnEscape:true, recreateForm: true,mtype: 'POST',url: 'ProfileServ',delData: {action: 'profileDelete',profileID: function () {return profileID;}},closeOnSubmit: true},
            {closeOnEscape: true, multipleSearch: true, closeAfterSearch: true,width: 700},
            {recreateForm: true,width:700,navkeys: [true,38,40],closeOnEscape:true});

In My colModel 4 column are hidden, because I doesn’t want them to be shown in tabular format. I want to show those columns when user wants to Insert or Update the data.

So in my code I am setting those columns properties to cm.hidden=false; on beforeShowForm event. but the problem is that When user wants to edit the data he has to click twice on the edit button, on first click only two columns are shown which are not hidden in colModel, and when user clicks twice on the edit button then the fields which I have set cm.hidden=false; are shown. Same thing is happening while Inserting the data.

I think I have placed recreateForm: true at wrong place or in wrong event.

Thanks in advance.

  • 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-18T18:58:18+00:00Added an answer on June 18, 2026 at 6:58 pm

    Just set the hidden rows to have the following property:

    editable:true, editrules: {edithidden:true}},
    

    JSfiddle example
    http://jsfiddle.net/dumbguy5689/9ueDL/4/

    • 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, Database: Oracle10).
I am developing a web application using JSP & Servlet (IDE: Eclipse, Database: Oracle10).
I am developing a web application using JSP & Servlet (IDE: Eclipse, Database: Oracle10).
I am developing a web application using JSP & Servlet (IDE: Eclipse, Database: Oracle10).
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 using JSP & Servlet. I am new to
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

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.