显示json结果的数据 [英] Show Data of json result
本文介绍了显示json结果的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨朋友们..
我正面临着一个成功的问题我正在调整数据但是如何使用jquery i在页面上显示数据为此做了一些代码。
$( document )。ready( function (){
// Dropdownlist Selectedindexchanged
$(' #lstAsgname')。change(函数(){
// alert($('#lstAsgname')。val( ));
$ .ajax({
url: DropDown / DdlSelectedIndex ,
类型:' post',
成功: function (data){
debugger ;
$( #ProjectTable)。jqGrid({
datatype:< span class =code-string>' json',
mtype:' GET',
colNames:[' ID',' 名称', ' 状态',' 类别'],
height: 500 ,
pager:jQuery(' #pager'),
jsonReader:{
root: rows,
// 包含实际数据的数组
页: page,
// 当前页
总计: < span class =code-string> total,
// 总页数查询
记录: 记录,
// 记录总数
repeatitems: false ,
id: ID
// 包含PK的列的索引
},
colNames:[' ID',' 名称',' 状态',' 类别'],
contentType: application / JSON; charset = utf-8,
dataType: json,
colModel:[
{name:' ID',index:' ID',width: 40 ,height:< span class =code-digit> 100 ,align:' left'},
{name:' 名称',索引:' 名称',宽度: 400 ,身高: 100 ,对齐:' left'},
{name :' 状态',索引:' 状态' ,width: 100 ,身高: 100 ,对齐:' left'},
{name:' 类别',索引:' 类别',宽度: 300 ,身高: 100 ,对齐:' left'}],
sortname:' ID',
sortorder: desc,
viewrecords: true ,
标题:' Team Fourm'
});
}
});
})
});
请帮我解决这个问题.....
谢谢
解决方案
( document )。ready( function (){
// Dropdownlist Selectedindexchanged
(' #lstAsgname')。change( function (){
// alert(
( '#lstAsgname')VAL()); 跨度>
Hi friends..
I am facing one problem that is in success function i am geting the data but how to show that data on the page using jquery i have done some code for this.
$(document).ready(function () {
//Dropdownlist Selectedindexchanged
$('#lstAsgname').change(function () {
// alert($('#lstAsgname').val());
$.ajax({
url: "DropDown/DdlSelectedIndex",
type:'post',
success: function (data) {
debugger;
$("#ProjectTable").jqGrid({
datatype: 'json',
mtype: 'GET',
colNames: ['ID', 'Name', 'Status', 'Category'],
height: 500,
pager: jQuery('#pager'),
jsonReader: {
root: "rows",
//array containing actual data
page: "page",
//current page
total: "total",
//total pages for the query
records: "records",
//total number of records
repeatitems: false,
id: "ID"
//index of the column with the PK in it
},
colNames: ['ID', 'Name', 'Status', 'Category'],
contentType: "application/json; charset=utf-8",
dataType: "json",
colModel: [
{ name: 'ID', index: 'ID', width: 40, height: 100, align: 'left' },
{ name: 'Name', index: 'Name', width: 400, height: 100, align: 'left' },
{ name: 'Status', index: 'Status', width: 100, height: 100, align: 'left' },
{ name: 'Category', index: 'Category', width: 300, height: 100, align: 'left'}],
sortname: 'ID',
sortorder: "desc",
viewrecords: true,
caption: 'Team Fourm'
});
}
});
})
});
Please help me to solve this issue.....
Thanks
解决方案
(document).ready(function () { //Dropdownlist Selectedindexchanged
('#lstAsgname').change(function () { // alert(
('#lstAsgname').val());
这篇关于显示json结果的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文