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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:38:46+00:00 2026-06-01T16:38:46+00:00

This is my jqGrid handler. var myEditParams = { keys: true, extraparam: { ajax:

  • 0

This is my jqGrid handler.

var myEditParams = {
    keys: true,
    extraparam: {
        ajax: function () {
            alert("in myEditParams:extraparam");
            return "1";
        }
    }
};
var lastsel;
jQuery("#list2").jqGrid({
        data: data,
        height: 250,
        emptyDataText: "No Records Found",
        width: $('#mainwrapper').width(),
        datatype: "local",        
        colNames:['Table Description','Display Table name'],
        colModel:[
            { name:'table_desc', index:'table_desc', sortable: false, align: 'left', editable: true, edittype: 'text', editoptions:{ size:40 }, formatoptions:{
                keys: true,
                editOptions: myEditParams
            } },
            { name:'display_table_name',index:'display_table_name', sortable: false }
        ],
        loadComplete: function(){
            $('.ui-jqgrid-htable').css('width',$('#mainwrapper').width()+'px');
             if ($('#list2').getGridParam('records') == 0){ // are there any records?
                DisplayEmptyText(true);
             }else{
                DisplayEmptyText(false); 
             }                    
        },
        rowNum:10,
        rowList:[10,20,30],
        pager: '#pager2',
        sortname: 'id',
        viewrecords: true,
        sortorder: "desc",
        caption:"Changelog Tables",
        postData: { ajax: "1" },
        onSelectRow: function(id){
            if(id && id!==lastsel){
                jQuery('#list2').jqGrid('restoreRow',lastsel);
                jQuery('#list2').jqGrid('editRow',id,true);
                $('#list2').jqGrid('setGridParam',id,{ ajax:"1" }); //wanted to set some custom params here.
                lastsel=id;
            }
        },
        editurl: "changeLog.php"
    });

I want to send one extra param as ajax=1, when I do some in-place edit operation. I have tried every way. But nothing seems to work. I am almost frustrated.

I tried this:

$("#list2").jqGrid('setGridParam',{postData:{ajax:'1'}});

Didn’t work. I also tried setting postData param as you can see in the handler. That too is not working. What is going wrong here? Please help me with this

  • 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-01T16:38:48+00:00Added an answer on June 1, 2026 at 4:38 pm

    The method editRow supports extraparam. So you can rewrite onSelectRow so:

    onSelectRow: function (id) {
        var $myGrid = $(this); // it's better as jQuery('#list2')
        if (id && id !== lastsel) {
            $myGrid.jqGrid('restoreRow', lastsel);
            $myGrid.jqGrid('editRow', id, {
                keys: true,
                extraparam: { ajax: "1" }
            });
            lastsel = id;
        }
    }
    

    By the way you can use methods (functions) instead of properties in the extraparam. It can be helfull in the following case. The values like extraparam: { ajax: $("#myControl").val() } will be calculated at the moment of the call the editRow function. If you would be use extraparam: { ajax: function () { return $("#myControl").val(); } } then the value of ajax parameter will be evaluated at the moment of saving of the value. At the moment the $("#myControl").val() can have another value.

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

Sidebar

Related Questions

I've implemented a JQGrid table with loadonce:true like this : jQuery(#list).jqGrid({ datatype: 'jsonstring', datastr
The following example code will load a jqGrid (this code works) ... jQuery(document).ready(function ()
I can change the text color by doing this in jqgrid custom formatter: function
My Colmodel in javascript looks like this jQuery(#testGrid).jqGrid( //Some code colModel: [ { name:
I am new to AJAX and jQuery so please excuse me if this is
I have this jqgrid definition and I'm trying to open the selected document in
I've setup a jqGrid like this $('#gridTable').jqGrid({ url: '/GridData/', ... Now if I navigate
I have this mysql tables I want to display with jqgrid. The problem appears
I am using treegrid with jqGrid and am quite new to this plugin. I
I am having trouble constructing a jqGrid TreeGrid using local data. This method works

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.