Results 1 to 5 of 5

Thread: HELP !!: Store not loading/parsing data from direct response

  1. #1
    Sencha User
    Join Date
    Jul 2008
    Vote Rating

    Default HELP !!: Store not loading/parsing data from direct response


    I have a model:

    PHP Code:
    Ext.define('Affiliation.model.FaxNumber', {
    extend '',
    idProperty 'Id',
    name 'Id'type'int'},
    name 'CountryCode'type 'string'},
    name 'AreaCode'type 'string'},
    name 'SubscriberNumber'type 'string'}
    proxy:{    type:'direct',
    totalProperty 'total',
    successProperty 'success',
    reader : {type 'json'root 'data'},
    writer : {type 'json'encode false},
    api : {,
    if I create a store:

    var FaxNumbers = Ext.create('',{model : 'Affiliation.model.FaxNumber',autoLoad : true , filters: [{property : 'AffiliationId', value : 3}]

    It sends out :


    which is fine

    the server returns (Faxnumber changed for this post)

    {"tid": 6, "action": "Affiliation_FaxNumber", "type": "rpc", "method": "read", "result": {"total": 1, "data": [{"AreaCode": "(0)223", "SubscriberNumber": "<REMOVED>", "Id": 3, "CountryCode": "+31"}], "success": true}}

    then I do a FaxNumer.each(......) which does not do anything, so I typed FaxNumer in the console (Safari) and open up the Object.

    Just to see that the Data array contains NO data.

    (the data below is from the console so the small Arrows for object expansion are gone)

    Note the totalCount : 1 !!

    if I do the same but init the sore with autoLoad : false, totalCount is NOT there, but after a FaxNumbers.Load() totalCount gets 1

    autoLoad: true
    data: Object
    allowFunctions: false
    events: Object
    getKey: function (record) {
    items: Array (0)
    keys: Array (0)
    length: 0
    map: Object
    sorters: Object
    __proto__: Object
    events: Object
    eventsSuspended: false
    filters: Object
    groupers: Object
    loading: false
    model: function () {
    modelDefaults: Object
    proxy: Object
    removed: Array (0)
    snapshot: Object
    sorters: Object
    totalCount: 1
    __proto__: Object

  2. #2
    Sencha User evant's Avatar
    Join Date
    Apr 2007
    Sydney, Australia
    Vote Rating


    totalProperty and successProperty aren't valid proxy options, they belong on the reader, not that it should be causing any problem.

    I'd suggest you look at the example:
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Sencha User
    Join Date
    Jul 2008
    Vote Rating


    Thanks but not much of a help,

    I can still not figure out what type : 'direct' really means. seems incapable of full CRUD and keeps moaning about directFN and I need to specify my proxies on the model. (long story, wrong place)

    There are no CRUD examples, and again, and again, and again, and again, and again .......
    the 4.0 docs on Direct/data/models/stores are confusing or possibly incorrect and FAR from clear.

    and models/stores behave really weird when using Direct CRUD.

    Everytime I ask a question, you guys respond look at that grid example. which uses DirectFN

    Get me a working store/model/direct/CRUD example please, please.

    I have allready spent 200 hours of experimenting with properties to get a store working over direct getting all kinds of stupid and weird errors. The Docs are extremely incomplete when it goes about details.

    So there is the IdProperty on a Model, I have still not seen anything change to whatever you set it. I thought it was to set which property on the model is the "id" of the record. but if I set it, the whole lot of code which is building the request to the server ends up sending "id" period.

    I got the store loading now, but now <modelInstance>.load is undefined again.

    Thanks for the effort though


    (Is there really nobody capable of helping me with Direct/crud/stores and models ?)

  4. #4
    Sencha User
    Join Date
    Dec 2012
    Vote Rating


    This might or might not help, but here is a working example using a direct proxy, but it uses a sales force database. Notice how at the end you have to provide some proxy extension for Sencha and the server to talk.

  5. #5

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts