AJAX object data formats? E.g.: Pagination
Is there a "generic" expected data structure to hold data for a datagrid? I'm using 开发者_开发问答JSON something like this right now and it's working well...
{
"pagination": {
"currentPage": 4,
"totalPages": 8
},
"headers":["id","name","postal_code","email"],
"data":[
["12345","Tran Smith","55505","tran@example.org"],
... more data rows here ...
]
}
But I get the nagging feeling it could be better, more reusable.
There are many libraries that have datagrid style components, and it would be great to see different examples of how this is handled.
It would be useful if for whatever reason a library got out of date if we could re-use the same AJAX for different projects which use different libraries.
精彩评论