1. #1
    Sencha User
    Join Date
    Jun 2011
    Location
    Ukraine, Mykolayiv
    Posts
    99
    Vote Rating
    1
    rsqw is on a distinguished road

      0  

    Default Problem with model.load

    Problem with model.load


    Hi,

    In data package there are alot of bugs, and I suppose this is one of them.
    Suppose I have this code.
    Code:
    Ext.define('Task', {
        extend: "Ext.data.Model",
        idProperty: "taskId",
        fields:[{name: "taskId"}, {name: "message"}],
        proxy: {
           type: "ajax",
           url:URL,
           reader: {
             type: "json",
             root: "items"
          }
       }
    });
    Now I want to load new task:
    Code:
    Task.load(100, {
       success: function() {
            alert('works');
       }
    }); -->> this will send ajax-query http://hostname/index.php?id=100
    My question: Why in the request-params there is an ID?
    As far as I understand it MUST BE taskId, isn't??
    In my case I need to send http://hostname/index.php?taskId=100, so how I can fix this?

    Thanks.

  2. #2
    Sencha User KJedi's Avatar
    Join Date
    Feb 2008
    Location
    Ukraine, Mykolayiv
    Posts
    145
    Vote Rating
    1
    KJedi is on a distinguished road

      0  

    Default


    I think they just ignore the value of idProperty and the only way to make it work is to patch ExtJS. Again

  3. #3
    Sencha User
    Join Date
    Sep 2011
    Posts
    8
    Vote Rating
    1
    jaimearmero is on a distinguished road

      0  

    Default


    Similar problem here. ExtJS 4.1.0-beta1. Model defined as

    Code:
    Ext.define('MyApp.model.Grupo', {
        extend : 'Ext.data.Model',
        idProperty : "key",
        
        fields : [
    
    
        // key : 
        {
            name : "key",
            type : 'string'
        }
        
        // cod : 
        ,{
            name : 'cod',
            type : 'string'
        }
            ... // etc...
    But trying to send the model to a update method (POST to a Rest service), it sends:

    Code:
    {"key":"","cod":"","descCor":"aaa"","id":""}
    It's adding an "id" property!!! Why it's ignoring our idProperty definition?
    BTW, in ExtJS 4.0.7-gpl it works ok.

    Thank you very much,

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar