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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:14:34+00:00 2026-05-26T10:14:34+00:00

I am creating a new jqgrid with these fields and features: Deployment id’,’Branch’, ‘Release

  • 0

I am creating a new jqgrid with these fields and features:

Deployment id’,’Branch’, ‘Release Name’,’Client id’,’# of hosts’,’Comments’,’Actions

-I have multiselect option on TRUE.

-I have edit/delete action in each row

-I have my navbar on bottom with the ADD/Search option.

My actions are:
when I ADD a new record I can add BRANCH field and Comment only (Thats works)
When I EDIT a record I can modify only COMMENT (that works too)

My problem is about MULTISELECT option…

If I click on EDIT button and the MULTISELECT is uncheck everything works fine.. means only COMMENT is allowed to modify.

but

If the row is selected in the Multiselect column the BRANCH field became Editable.

In addition I want to block other actions while I am editing one particularly row (means do not be able to Check/Uncheck EDIT/Delete another rows)

Can someone help to me to do that?

Thank

ps: I was trying with different code/examples I found here without success. I don’t publish it for now to avoid more confusion.

    var lastSel;
    $(function(){ 

 $("#list").jqGrid({

  data: mydata, 
  datatype: "local", 

  colNames:['Deployment id','Branch', 'Release Name','Client id','# of hosts','Comments','Actions'],
  colModel:[ 
      {name:'deployment_id',index:'deployment_id',align:"right", sorttype:"int", width:120},    
      {name:'branch',index:'branch',align:"center", formatter:branchColor,editable: true,edittype:"select",editrules:{required:true},editoptions:{value:"option 1:option1;option2:option2"}},           
      {name:'release_name',index:'release_name',align:"center"},    
      {name:'client_id',index:'client_id',align:"right", sorttype:"int", width:60}, 
      {name:'num_hosts',index:'num_hosts',align:"right", sorttype:"int", width:60},
      {name:'comments',index:'comments',align:"center", editable: true,edittype:"textarea", editoptions:{rows:"2",cols:"20"}},
      {name:'myac', width:80, fixed:true, sortable:false, resize:false, formatter:'actions',formatoptions:{keys:true}}  
  ],

         rowList : [20,30,50], 

         pager: '#pager', 
         sortname: 'deployment_id', 
         viewrecords: true,
         recordpos: 'right',      
         sortorder: "asc",
         sortable: true, 
       multiselect: true,
       shrinkToFit :true,
       viewrecords: true,


     onSelectRow: function(id){
        //alert("id:"+id);
        if (id == null) {
                         id = 0;
                                        if(id && id!==lastSel){

                                            //$('#list').jqGrid('restoreRow',lastSel);
                                            //$('#list').jqGrid('editRow',id,false);


                                            $("#jqg_list_" + id).attr("disabled","disabled");   
                                            lastSel=id;

                                        }
                    }
                    else {


                                var grId = $("#list").jqGrid('getGridParam','selrow');


    if(grId){
            $("#" + grId + "_branch").attr("disabled","disabled");
            $("#" + grId + "_branch").removeClass("editable");  
        }                                   

                    }                   
            },



}); 


// to modify The tool bar on bottom
$("#list").jqGrid('navGrid','#pager',{edit:false, edittitle: 'Modify a Deployment', 
                                         add:true, addtitle: 'Add a new Deployment',
                                         del:true, deltitle: 'Delete a Deployment',
                                         nav:{ addCaption: 'Columns'}
                                       },
{// edit option
 beforeShowForm: function(form) { 
                                   $('#branch', form).attr("disabled","disabled"); 

                                  },

//seems to be is not qworking   
 beforeSelectRow: function(rowid, e) { return false; },                               
 },

{// add option
 beforeShowForm: function(form) { 

                                    $('#branch option[value=""]', form).text('Select a branch')
                                    $('#branch option[value=""]', form).attr("selected", "selected");
                                    $('#branch', form).attr("disabled","");  



        var ids; 

    ids = $("#list").getGridParam('selarrrow'); 
    if(ids){        
                alert('array: ['+ids+']'); 
                alert('id in array[0]: '+ids[0]);
        }


                                   },
 addCaption: "Add a Deploymet"

},



{// delette option

},
{// Search option
    multipleSearch:true
},
{// view option

}   
);
  • 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-26T10:14:34+00:00Added an answer on May 26, 2026 at 10:14 am

    Finally I got it the answer testing a lot.. and I want to share that.. could be useful for some else.
    Basically I delete the OnSelectRow function and I modified the formatoptions:{}adding the tag onEdit

    I add the example/DEMO running in this link: DEMO ONLINE

    var mydata = [
    
        {
        "branch": "PACS-3-3-1",
        "comments": "migrated deployment",
        "client_id": 27,
        "deployment_id": 249,
        "release_name": null,
        "num_hosts": 12},
    
    {
        "branch": "PACS-3-1-1",
        "comments": "migrated deployment",
        "client_id": 27,
        "deployment_id": 144,
        "release_name": null,
        "num_hosts": 9},
    
    {
        "branch": "PACS-2-4-1",
        "comments": "2.6.1",
        "client_id": 27,
        "deployment_id": 78,
        "release_name": null,
        "num_hosts": 0},
    {
        "branch": "PACS-2-4-2",
        "comments": "PACS-2-4-2",
        "client_id": 27,
        "deployment_id": 46,
        "release_name": null,
        "num_hosts": 0}
    
    ];
    
    var lastSel;
    
    
    $("#list").jqGrid({
    
        data: mydata,
        datatype: "local",
    
        colNames: ['Deployment id', 'Branch', 'Release Name', 'Client id', '# of hosts', 'Comments', 'Actions'],
        colModel: [
            {
            name: 'deployment_id',
            index: 'deployment_id',
            align: "right",
            sorttype: "int",
            width: 120},
        {
            name: 'branch',
            index: 'branch',
            align: "center",
            editable: true,
            edittype: "select",
            editrules: {
                required: true
            },
            editoptions: {
                value: "option 1:option1;option2:option2"
            }},
        {
            name: 'release_name',
            index: 'release_name',
            align: "center"},
        {
            name: 'client_id',
            index: 'client_id',
            align: "right",
            sorttype: "int",
            width: 60},
        {
            name: 'num_hosts',
            index: 'num_hosts',
            align: "right",
            sorttype: "int",
            width: 60},
        {
            name: 'comments',
            index: 'comments',
            align: "center",
            editable: true,
            edittype: "textarea",
            editoptions: {
                rows: "2",
                cols: "20"
            }},
        {
            name: 'myac',
            width: 80,
            fixed: true,
            sortable: false,
            resize: false,
            formatter: 'actions',
            formatoptions: {
                keys: true,
                //hace que se abra el popup, en lugar de inlineedit
                //editformbutton: true,
                onEdit: function(rowid) {
                    //alert("in onEdit: rowid=" + rowid + "\nWe don't need return anything");
                    $("#" + rowid + "_branch").attr("disabled", "disabled");
                    $("#" + rowid + "_branch").removeClass("editable");
                }
            }}
        ],
    
        rowList: [20, 30, 50],
    
        pager: '#pager',
        sortname: 'deployment_id',
        viewrecords: true,
        recordpos: 'right',
        sortorder: "asc",
        sortable: true,
        multiselect: true,
        shrinkToFit: true,
    
    
    
    //    onSelectRow: function(id) {
            //alert("id:"+id);
           // if (id === null) {
           //     id = 0;
    //            if (id && id !== lastSel) {
    
                    //$('#list').jqGrid('restoreRow',lastSel);
                    //$('#list').jqGrid('editRow',id,false);
    
    //                $("#jqg_list_" + id).attr("disabled", "disabled");
    //                lastSel = id;
    
    //            }
    //        }
    //        else {
    
    
    //            var grId = $("#list").jqGrid('getGridParam', 'selrow');
    
    
    //            if (grId) {
    //                $("#" + grId + "_branch").attr("disabled", "disabled");
    //                $("#" + grId + "_branch").removeClass("editable");
    //            }
    
            //}
       // }
    
    
    
    });
    
    
    // to modify The tool bar on bottom
    $("#list").jqGrid('navGrid', '#pager', {
        edit: false,
        edittitle: 'Modify a Deployment',
        add: true,
        addtitle: 'Add a new Deployment',
        del: true,
        deltitle: 'Delete a Deployment',
        nav: {
            addCaption: 'Columns'
        }
    }, { // edit option
       // beforeShowForm: function(form) {
       //     $('#branch', form).attr("disabled", "disabled");
    
       // },
    
        //seems to be is not qworking   
        beforeSelectRow: function(rowid, e) {
            return false;
        }
    },
    
    { // add option
        beforeShowForm: function(form) {
    
    
            $('#branch', form).prepend("<option value=''>Select a branch</option>")
            //$('#branch option[value=""]', form).text('Select a branch');
            $('#branch option[value=""]', form).attr("selected", "selected");
            //$('#branch', form).attr("disabled", "");
    
    
    
            var ids;
    
            ids = $("#list").getGridParam('selarrrow');
            if (ids) {
                //alert('array: [' + ids + ']');
                //alert('id in array[0]: ' + ids[0]);
            }
    
    
        },
        addCaption: "Add a Deploymet"
    
    },
    
    
    
    { // delette option
    }, { // Search option
        multipleSearch: true
    }, { // view option
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 custom fields in my WordPress system when creating new posts. One
Actually creating a filter jqGrid toolbar should be straight ahead as in the new
I have problem creating new instance of excel 2007 using VBA (from Access 2002).
When I'm creating new project with GWT plug in it creates a skeleton project
I'm creating new Site Definitions using this method: http://weblogs.asp.net/paulballard/archive/2007/04/09/creating-a-custom-sharepoint-2007-portal-site-definition-using-the-portalprovisioningprovider-class.aspx and when they get created,
Can I avoid third party code from creating new threads, starting new VMs, or
I need UNION two tables with creating new field, where 1 for first table,
I need to restrict the development users from creating new schedules for SQL Agent
How can this be done more elegant and without creating new objects? List<Move> playerMoves
I have some conditional formatting styles. I don't want to keep creating new rules

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.