0

I'm trying load data from server and bind data. Such method does not work. Whats wrong?

Ext.define('Configurator.view.activityType.ActivityTypeModel', {
    extend: 'Ext.app.ViewModel',
    alias: 'viewmodel.activityTypeModel',
    stores: {
      ticketStatusSummary: {
       fields: ['id', 'title', 'name'],
       autoLoad: true,
       proxy: {
                url: '{prefix}/{entityName:uncapitalize}',
                pageParam: '{pagaParam}',
                startParam: '{startParam}',
                limitParam: '{limitParam}'
            }  }
    }
...
Max
  • 417
  • 7
  • 21
  • Where do you bind all the data in your viewmodel? You should only use a bind syntax for values you're going to actually provide. – Evan Trimboli Aug 01 '14 at 10:14
  • Hi Evan. I bind the data to the view, was the Problem with the fact that the proxy did not make a request to the server. – Max Aug 01 '14 at 10:25

2 Answers2

0

Problem is resolve. Problem is with the proxy - unknown reader

reader: {
            type: 'json',           
         }

Actual code:

Ext.define('Configurator.view.activityType.ActivityTypeModel', {
    extend: 'Ext.app.ViewModel',
    alias: 'viewmodel.activityTypeModel',
    stores: {
      ticketStatusSummary: {
       fields: ['id', 'title', 'name'],
       autoLoad: true,
       proxy: {
                url: '{prefix}/{entityName:uncapitalize}',
                pageParam: '{pagaParam}',
                startParam: '{startParam}',
                limitParam: '{limitParam}',
                reader: {
                        type: 'json',           
                }
            }  
        }
    }
... 
Max
  • 417
  • 7
  • 21
0

Im surprised that you have to define all of this inside your viewcontroller...

You should be able to do: (I'm still trying to actually figure this out, I dont think it is the right code.)

stores:{
    ticketSummary:'MyApp.stores.TicketSummary'
}
Patrick
  • 146
  • 1
  • 4
  • 13