jquery数据网格中的RetrieveStructure()的等价物 [英] Equivalent of RetrieveStructure() in jquery datagrids

查看:77
本文介绍了jquery数据网格中的RetrieveStructure()的等价物的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个与自动列检测相当的WinForms DataGridView 数据绑定,用于jquery数据网格,它将从json数据输入中提取列而不用我定义它。



我见过的所有例子都是:

I'm looking for an equivalent of the WinForms DataGridView data binding with automatic column detection, for a jquery datagrid which will extract the columns from the json data input without me defining it.

All the examples I have seen are like :

jQuery("#jsonmap").jqGrid({ 
url:'server.php?q=4', 
datatype: "json", 
colNames:[
'Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'], 
colModel:[ 
{name:'id',index:'id', width:55}, 
{name:'invdate',index:'invdate', width:90, jsonmap:"invdate"}, 
{name:'name',index:'name asc, invdate', width:100}, 
{name:'amount',index:'amount', width:80, align:"right"}, 
{name:'tax',index:'tax', width:80, align:"right"}, 
{name:'total',index:'total', width:80,align:"right"}, 
{name:'note',index:'note', width:150, sortable:false} ], 
rowNum:10, 
rowList:[10,20,30], 
pager: '#pjmap', 
sortname: 'id', 
viewrecords: true, sortorder: "desc", 
jsonReader: { repeatitems : false, id: "0" }, 
caption: "JSON Mapping", height: '100%' }); 
jQuery("#jsonmap").jqGrid('navGrid','#pjmap',{edit:false,add:false,del:false});



在绑定之前定义列。


Which define the columns before binding .

推荐答案

请参阅我对该问题的评论。基本上,你在编写HTML时读取数据并读取它,某些块元素的内部HTML,如 div http://api.jquery.com/html/ [ ^ ]),使用来自jQuery类别操纵的API: http://api.jquery.com/category / manipulation / [ ^ ]。



-SA
Please see my comments to the question. Basically, you get the data and read it while writing HTML, inner HTML of some block element like div (http://api.jquery.com/html/[^]), using API from jQuery category "manipulation": http://api.jquery.com/category/manipulation/[^].

—SA


这篇关于jquery数据网格中的RetrieveStructure()的等价物的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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