Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I use two jqgrid. I want when click on row in grid1 then grid2 show data by Ajax on base parameters of grid1. How to change data of grid2 by Ajax? this code for grid2

JavaScript
$("#gridrelatedLette").jqGrid(
{
    url: "GetLetterInformationHandler.ashx?CurrentUser=" + 1157 + "&IndCode=" + rowData["PctIndCode"] + "&IndSerial=" + rowData["PctIndNum"] + "&TabName=relatedLetters",
    datatype: 'json',
    width: $("#relatedLetterTab").width()-20,
    height: a1,
    direction: "rtl",
    colNames: ['1', '2', '2', '3', '4', '5','6',],
    colModel: [
        { name: 'IRltType', width: 40, sortable: false, hidden: false, template: CenterTemplate },
        { name: 'IRltLettDate', width: 60, sortable: false, hidden: false, template: CenterTemplate },
        { name: 'IRltLettNum', width: 60, sortable: false, hidden: false, template: CenterTemplate },
        { name: 'IRltLettType', width:30, sortable: false, hidden: false, template: CenterTemplate },
        { name: 'IndTopic', width: 100, sortable: false, hidden: false, template: CenterTemplate },

    ],
    rowNum: 20,
    loadonce: true,
    rowList: [5, 10, 20],
    recordpos: "left",
    ignoreCase: true,
    toppager: true,
    viewrecords: true,
    sortorder: "desc",
    scrollOffset: 1,
    editurl: 'clientArray',
    shrinkToFit: true ,
    jsonReader:
    {
        repeatitems: false,
    },
    rowattr : function(rd) {
        return { "class": "myRowClass" };
    },
    gridview: true,
});

This code is a function that when click on one of the row of grid1 is called and rowData means the information of row(this function call in selectedrow of grid1 and parameter change by click on row."relatedLetters" is name of tab that jqgri2 inside this tab
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900