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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:06:07+00:00 2026-06-14T02:06:07+00:00

Can anyone tell me how I can make inline editing for one particular column

  • 0

Can anyone tell me how I can make inline editing for one particular column false, but when you edit the particular row that colum is editable for example –

{name:'product_image', index:'ProductId', width:25, align:'right', editable:true, edittype:'file'},

This works perfectly, I can edit this by selecting the row and clicking the edit button< I will then be presented with the edit dialog, I can then change the value of said column. I want to make the column in the grid view readonly however, I have found the following –

{name:'product_image', index:'ProductId', width:25, align:'right', editable:false, edittype:'file',editoptions:{readonly: false}},

However this just makes the column read only and in edit mode I cannot change the value.

$("#list").jqGrid({
    url:'products.php?storeId=<?php echo $_SESSION["valid_store"]; ?>',
    datatype: 'xml',
    mtype: 'GET',
    colNames:['Product Id','Product Description','Department','Category','Price','Sale Price','Quantity','Extended Description','Web Item','Image'],
    colModel :[ 
      {name:'ProductId', index:'ProductId', width:20}, 
      {name:'product_name', index:'product_name', width:50, editable:true, edittype:'text', search:true, stype:'text'},
      {name:'DepartmentName', index:'DepartmentName', width:40,sortable: false, editable: true, edittype: "select"},
      {name:'CategoryName', index:'CategoryName', width:40,sortable:false, editable:true, edittype:'select'}, 
      {name:'price', index:'price', width:15, align:'right', editable:true, edittype:'text'}, 
      {name:'sale_price', index:'sale_price', width:15, align:'right', editable:true, edittype:'text'}, 
      {name:'product_qty', index:'product_qty', width:10, align:'right', editable:<?php if($edit_qty == 1){echo "true";}else{echo "false";} ?>, edittype:'text'}, 
      {name:'product_description', index:'product_description', width:100, sortable:false, editable:true, edittype:'text'},
      {name:'web_item', index:'web_item', width:15,sortable:false, editable:true, edittype:'select',editoptions:{value:{1:'True',0:'False'}}}, 
      {name:'product_image', index:'ProductId', width:25, align:'right', edittype:'file', editable: false},
    ],
    loadComplete:function(){
        $("#list").setColProp('DepartmentName', { editoptions: { value: departments} });
        $("#list").setColProp('CategoryName', { editoptions: { value: categories} });
    },
    pager: '#pager',
    rowNum:40,
    rowList:[10,20,30,40,50,60,70,80,90,100],
    sortname: 'ProductId',
    sortorder: 'desc',
    viewrecords: true,
    gridview: true,
    caption: 'Products',
    autowidth: true,
    height: tableHeight,
    cellEdit: true,
    loadtext: 'Loading Products...',
    cellurl: 'edit_product.php?storeId=<?php echo $_SESSION["valid_store"]; ?>',
    editurl: 'edit_product.php?storeId=<?php echo $_SESSION["valid_store"]; ?>',
  }).navGrid('#pager',
    {
        del: false,
        add: <?php if($add_products == 1){echo "true";}else{echo "false";}?>,
        edit: true,
        search: true
    },
    {jqModal:true,closeAfterEdit: false,recreateForm:true,onInitializeForm : function(formid){
        $(formid).attr('method','POST');
        $(formid).attr('action','');
        $(formid).attr('enctype','multipart/form-data');
        },
        beforeShowForm:function(form){
            $("#product_image", form).attr("disabled", "false");
        },

Thanks

  • 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-14T02:06:08+00:00Added an answer on June 14, 2026 at 2:06 am

    If I understand your problem currently you can set readonly attribute on $("#product_image") field from the editing form inside of beforeShowForm callback. See the answer or this one for the corresponding code example.

    UPDATED: From the code which you posted one can see that you use cell editing (cellEdit: true). The usage of cell editing together with other editing mode (form editing or inline editing) of jqGrid is not supported.

    Probably the usage of cellEdit: true was by accident? In the case you should just remove the option to fix the problem.

    If you do need to use cell editing you can add ‘not-editable-cell’ class to the ‘product_image’ column. You can use classes: "not-editable-cell" in the colModel or you can make it dynamically if required (see the demo from the answer). The class will be used only by cell editing and will be ignored by form editing.

    If you really require to use both cell editing and form editing you will have to call restoreCell or saveCell (see the documentation) before starting of form editing (in beforeInitData for example). All parameters of the method you can save inside of the last called beforeEditCell callback.

    The last remark to your code: it seems me very strange that you use index:'ProductId' for two columns: ProductId and product_image. Is it typing error probably?

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

Sidebar

Related Questions

Can anyone tell me how to make a div's background transparent, but with a
I have some UITextFields and one button, Can anyone tell me how to make
Can anyone tell me how can i make more then one view through single
I know how to make columns with CSS. But Can anyone tell me how
Can anyone tell me how to make this happen? It looks like a setting.
Can anyone tell me, how to make shadow, using UIPageViewController, around of my background
I want to make an Android app by using ZXing . Can anyone tell
Can anyone please tell me how do I make this script run in IE
I want to make a drop-down list from scratch. Can anyone please tell me
Can any one tell me how can I make divs visible in ASP.NET. I

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.