0
votes

I want to make a simple request like Ext.Ajax.request and display it in a list. But it does not work.

I have a URL like this

http://server/GetContacts.aspx?CustAccount=10019

Can someone tell me exactly how it works and what I should consider?

This is an example of what I get back.

{
  "HasError": false,
  "ErrorString": "",
  "Data": [
    {"ContactPersonId":"","Name":"","FirstName":"","MiddleName":"","LastName":"","Phone":"","CellularPhone":"","Telefax":"","Email":"","Url":"","Address":"","ZipCode":"","City":"","Street":"","Country":"","Function":""}
  ]
}
1

1 Answers

0
votes
    Ext.regModel('kunden', {
                    idProperty: 'id',
                    fields: [
                        { name: 'ContactPersonId', type: 'string' },
                        .
                        .
                        .

                        { name: 'Function', type: 'string' }

                    ]
                });

                Ext.regStore('kundenStore', {
                    model: 'kunden',
                    sorters: [{
                        property: 'LastName'
                    }],

                    proxy: {
                        type: 'ajax',
                        url: 'http://server/GetContacts.aspx?CustAccount=10019'
                    },
                    reader: {
                        type: 'json',
                        root: 'Data'
                    }
                });
NotesApp.views.kundenList = new Ext.List({
                    id: 'kundenList',
                    store: 'kundenStore',
                    grouped: true,
                    indexBar    : true,
                    itemTpl: '<div class="list-item-title">{firstname} {lastname}</div>' +'<div class="list-item-narrative">{email}</div>',
                    listeners: {}
                    }
                });

It can be so easily XP