[英]Displaying data in Jqgrid
I have a value stored in array variable item
like 我有一个存储在数组变量item
的值,例如
var item = JSON.stringify(product);
cartproduct[cartproduct.length] = item;
item
holds data such as item
包含以下数据
{
"Product": "1001",
"Brand": "Dell",
"Model": "Inspiron ",
"Price":"25000"
}
Now i want to display this item
data in respective jqgrid columns like Product, Brand, Model .. 现在,我想在相应的jqgrid列(例如产品,品牌,型号..)中显示该item
数据。
I saw one jsFiddle example like http://jsfiddle.net/amorris/yNw3C/ 我看到了一个jsFiddle示例,例如http://jsfiddle.net/amorris/yNw3C/
Now all I want is my item
value in the format of data
. 现在,我想要的只是data
格式的item
值。
var data = [[48803, "DSK1", "", "02200220", "OPEN"]];
var item = [[1000,"Sony","Vaio",40000]];
Try this: 尝试这个:
var itemFormatted = [[
item.Product,
item.Brand,
item.Model,
item.Price
]];
// Now itemFormatted will be in the correct format
Check out Working with Javascript objects for more information. 请查看使用Javascript对象以获取更多信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.