English 中文(简体)
jqGrid Add Row Data Enrique Object
原标题:jqGrid Add Row Data Nested Object
  • 时间:2011-10-31 11:31:26
  •  标签:
  • json
  • jqgrid

我有一栏模式:

...
{name: password ,index: password , width:100},
{name: type.name ,index: type.name , width:100},
...

我的班子,例如:

var MyObject = function (password, type) {
    this.password = password;
    this.type = type;
};

var MyType = function (tname) {
    this.tname = tname;
};

我罗列了我的变数:如同:

var type = new MyType($( #typeList ).val());
var myObject = new MyObject($( #password ).val(), type);

我有我的服务器对JSON数据的答复,其中某些元件为同类物体。 当我想在我的电网上显示他们。 然而,当我想使用添加数据功能时,我看不到<条码>类型栏的任何内容。 我这样做了:

$("#gridId").jqGrid( addRowData , myObject.password, myObject, "first");

班级是名称、密码等功能。 问题仅涉及一些特有因素(我可以见过密码等)。 <代码>addrowData fonction]. 接受一个阵列,但我寄出一个物体。 我怎么能够把我的物体变成一个简单的物体阵列?

任何想法?

最佳回答

您不应在<代码>上使用上的财产! 如有必要,请在<代码>index或jsonmap中使用。

http://www.trirand.com/jqgridwiki/doku.php?id=wiki%3amethods” rel=“nofollow”>addRowData在你的例子中似乎是错误的。 http://www.trirand.com/jqgridwiki/doku.php?id=wiki%3amethods”rel=“nofollow”>addRowData

问题回答

暂无回答




相关问题
JQuery/MVC Search Issue

I have inherited a piece of work where the entry screen shows a summary of 20 calculated variables. E.g. Var A (250), Var B (79). Clicking on any of these links takes the user to a view with a ...

jQuery quicksearch plug-in tinkering with JSON

I ve implemented the quicksearch plugin by Rik Lomas and I love it for an application in a custom CMS I m building. I was wondering though, since I m going to have a bizillion items in the table if ...

JSON with classes?

Is there a standardized way to store classes in JSON, and then converting them back into classes again from a string? For example, I might have an array of objects of type Questions. I d like to ...

PHP json_decode question

i m trying to use json_decode to combine a few json objects and then re-encode it. my json looks like: { "core": { "segment": [ { "id": 7, "...

Converting JSON data to Java object

I want to be able to access properties from a JSON string within my Java action method. The string is available by simply saying myJsonString = object.getJson(). Below is an example of what the string ...

热门标签