JsRender+ JsViews | How to $.observable().insert to object inner array-Collection of common programming errors
Sample JSON: https://gist.github.com/mekkoo/6604902
I want using $.observable().insert method to object inner array “items”. but, I looked error “Uncaught TypeError: Object # has no method ‘insert'” when method calling
pages = //Sample JSON $.ajax calling
$.observable(pages).insert(pages.length, {
//I want this data to insert to "items" array
"item": {
"id": 3,
"item_name": "Item Name 3",
"item_desc": "Item Desc 3",
"item_img": "http://example.com/sample.png"
},
"values": [
{
"id": 0,
"key_id": 0,
"value": "Value 0"
},
{
"id": 1,
"key_id": 1,
"value": "Value 1"
},
{
"id": 2,
"key_id": 2,
"value": "Value 2"
}
]
});