问题重新加载jqgrid数据 [英] problem reload jqgrid data

查看:73
本文介绍了问题重新加载jqgrid数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用两个jqgrid。我想点击grid1中的行然后grid2通过Ajax在grid1的基本参数上显示数据。如何通过Ajax更改grid2的数据? grid2的代码



 $( #gridrelatedLette)。jqGrid(
{
url: GetLetterInformationHandler.ashx?CurrentUser = + 1157 + & IndCode = + rowData [ PctIndCode] + & IndSerial = + rowData [ PctIndNum] + & TabName = relatedLetters
数据类型:' json'
宽度: $( #relatedLetterTab)。width() - 20,
高度:a1,
方向: rtl
colNames:[< span class =code-string>' 1'' 2'' 2'' 3'' 4'' 5'' 6',],
colModel:[
{name:' IRltType',宽度: 40 ,可排序: false ,隐藏: false ,模板:CenterTemplate},
{name:' 我RltLettDate',宽度: 60 ,可排序: false ,隐藏: false ,template:CenterTemplate},
{name:' IRltLettNum' ,width: 60 ,可排序: false ,隐藏: false ,模板:CenterTemplate},
{名称:' IRltLettType',width: 30 ,可排序: false ,隐藏: false ,template:CenterTemplate},
{name:' IndTopic' ,width: 100 ,可排序: false ,隐藏: false ,template:CenterTem plate},

],
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 { < span class =code-string> class: myRowClass};
},
gridview: true
});



此代码是一个函数,当单击grid1的某一行时,rowData表示行的信息(此函数调用gridrow的selectedrow,参数通过点击行更改。relatedLetters是jqgri2里面的标签名称此选项卡

解决方案

#gridrelatedLette)。jqGrid(
{
url: GetLetterInformationHandler.ashx?CurrentUser = + 1157 + & IndCode = + rowData [ PctIndCode] + & IndSerial = + rowData [ PctIndNum] + & TabName = relatedLetters
数据类型:' json'
width:


< blockquote>( #relatedLetterTab)。width() - 20,
height:a1 ,
方向: rtl
colNames:[' 1'' 2'' 2'' 3'' 4 '' 5'' 6',],
colModel:[
{name:' IRltType',width: 40 ,可排序: false ,隐藏: false ,模板:CenterTemplate} ,
{name:' IRltLettDate',width: 60 ,可排序: false ,隐藏: false ,模板:CenterTemplate},
{name:' IRltLettNum',width: 60 ,可排序: false ,隐藏: false ,模板:CenterTemplate},
{name:' IRltLettType',width: 30 ,sortable: false ,隐藏: false ,模板:CenterTemplate},
{name:' IndTopic',width: 100 ,可排序: false ,隐藏: false ,模板:CenterTemplate},

],
rowNum:< span class =code-digit> 20 ,
loadonce: true
rowList:[ 5 10 20 ],
recordpos:< span class =code-string> 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
});



此代码是一个函数,当单击grid1的某一行时,rowData表示行的信息(此函数调用gridrow的selectedrow,参数通过点击行更改。relatedLetters是jqgri2里面的标签名称此选项卡


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

$("#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

解决方案

("#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


这篇关于问题重新加载jqgrid数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆