Вопрос по json – jqGrid JSON обозначение объектов

1

там!
У меня есть один столбец в моей jqGrid, который пуст.
Но я проверил объект на консоли Chrome, и это нормально.

colModel definition

colModel:[
    {name:'id',index:'id', width:55,editable:false,editoptions:{readonly:true,size:10},hidden:true},
    {name:'firstName',index:'firstName', width:100,searchoptions: { sopt: ['eq', 'ne', 'cn']}},
    {name:'lastName',index:'lastName', width:100,editable:true, editrules:{required:true}, editoptions:{size:10}},
    {name:'books[0].nome',index:'books[0].nome', width:100,editable:true, editrules:{required:true}, editoptions:{size:10}},
    {"formatter":"myfunction", formatoptions:{baseLinkUrl:'/demo/{firstName}|view-icon'}}
]

JSON response

{
    "total": "10",
    "page": "1",
    "records": "3",
    "rows": [
        {
            "id": 1,
            "firstName": "John",
            "lastName": "Smith",
            "books": [{"nome": "HeadFirst"}]
        },
        {
            "id": 2,
            "firstName": "Jane",
            "lastName": "Adams",
            "books": [{"nome": "DalaiLama"}]
        },
        {
            "id": 35,
            "firstName": "Jeff",
            "lastName": "Mayer",
            "books": [{"nome": "Bobymarley"}]
        }
    ]
}

chrome console inspect object

rowdata.books[0].nome
"HeadFirst"

Кто-нибудь знает, где возможен трюк?

Tks!

Ваш Ответ

2   ответа
1

Error: User Rate Limit ExceedednameError: User Rate Limit ExceededcolModelError: User Rate Limit Exceededname:'books[0].nome'Error: User Rate Limit Exceeded

Error: User Rate Limit ExceededjsonmapError: User Rate Limit Exceeded

{name: 'nome', jsonmap: 'books.0.nome', ...

Error: User Rate Limit ExceededjsonmapError: User Rate Limit Exceeded

{name: 'nome', jsonmap: function (item) {
        return item.books[0].nome;
    }, ...

Error: User Rate Limit ExceededjsonmapError: User Rate Limit ExceededError: User Rate Limit Exceeded, Error: User Rate Limit Exceeded, Error: User Rate Limit Exceeded, Error: User Rate Limit Exceeded, Error: User Rate Limit Exceeded.

0

nameError: User Rate Limit ExceededError: User Rate Limit Exceeded:

Set the unique name in the grid for the column. This property is required. As well as other words used as property/event names, the reserved words (which cannot be used for names) include subgrid, cb and rn.

Error: User Rate Limit Exceeded.nameError: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit Exceeded

var nm = {},
...
nm = $t.p.colModel[i].name;
...
res[nm] = $.unformat.call($t,this,{rowId:ind.id, colModel:$t.p.colModel[i]},i);

Error: User Rate Limit ExceededbookName.

Похожие вопросы