extjs - AJAX call to REST service doesn't display results in page but a call to the same response in a flat file does -


i'm trying make call wcf data services , display results in gridpanel.

the call works , returns correct json except gridpanel doesn't display results. tried copying returned json file on webserver , replacing destination url that. worked correctly , displays results.

so far can tell json, code , service correct don't work properly.

the ext js

ext.define('customer', {                 extend: 'ext.data.model',                 fields: ['id', 'customername'],                 proxy: {                     headers: {                         'accept' : 'application/json'                     },                     type: 'rest',                     url: 'service.svc/customers',                     reader: {                         type: 'json',                         root: 'd'                     }                 }             }); 

the json service

{     "d" : [         {             "__metadata": {                 "uri": "http://localhost:52332/testservice.svc/customers(1)",                  "type": "pierbridgeshineplatformtestmodel.customer"             },              "id": 1,              "customername": "fred",              "invoices": {                 "__deferred": {                     "uri": "http://localhost:52332/testservice.svc/customers(1)/invoices"                 }             }         },         {             "__metadata": {                 "uri": "http://localhost:52332/testservice.svc/customers(2)",                  "type": "pierbridgeshineplatformtestmodel.customer"             },              "id": 2,              "customername": "mr fred",              "invoices": {                 "__deferred": {                     "uri": "http://localhost:52332/testservice.svc/customers(2)/invoices"                 }             }         }     ] } 


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -