Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User alumb's Avatar
    Join Date
    Apr 2009
    Location
    Vancouver, BC, Canada
    Posts
    8
    Vote Rating
    0
    alumb is on a distinguished road

      0  

    Default Calling set from within a convert function

    Calling set from within a convert function


    REQUIRED INFORMATION

    Ext version tested:
    • Ext 4.1.0 rev Build date: 2012-04-20 14:10:47 (19f55ab932145a3443b228045fa80950dfeaf9cc)
    Browser versions tested against:
    • Chrome
    Description:
    • Calling Ext.data.Model.set from within another Ext.data.Model.set function call (ie via the convert function) causes infinite recursion.
    Steps to reproduce the problem:
    • Add a convert function to field1 that calls set('field2', value).
    • call set('field1',value).
    The result that was expected:
    • both fields are set to the same value
    The result that occurs instead:
    • infinite recursion
    HELPFUL INFORMATION


    I have two fields in a model such that when one ('title') is updated I need another ('text') to be updated. My solution in Ext.js 4.0 was to set the titles convert function to :
    Code:
    convert: function(value, me) { me.set('text',value); return value };
    this ment that when set('title',value) was called, the text value was also set. However in Ext.js 4.1, this breaks.


    Code:
        // This object is used whenever the set() method is called and given a string as the
        // first argument. This approach saves memory (and GC costs) since we could be called
        // a lot.
        _singleProp: {},
    This means that if sets are called recursivly, the same object is used, and it throws Ext.js into an infinite recusion. The second time set is called the _singleProp object has both 'title' and 'text' properties and it infinitly tries to set 'title', which causes another set to be called, causing it to try to set 'title'.... and so on.


    I understand that using a common object is a good idea, but there needs to be a solution for if set is called from within another set.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,519
    Vote Rating
    814
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    The correct way for a field to be updated even if you are using a convert method is to set the field as an empty string. So in your case when you are updating the record you should set the text field to an empty string and the convert method for that field will fire.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    May 2011
    Posts
    14
    Vote Rating
    1
    Decoy Deluxe is on a distinguished road

      0  

    Default Come again?

    Come again?


    Mitchell - can explain that answer please.

    If I need to set field B to 'world' when field A is set to 'hello' like this:

    Code:
    convert : function(value, record) {
    if(value === 'hello') {
    record.set('B', 'world');
    }
    }
    I get a recursive loop of death. Setting B to an empty string has the same outcome.

  4. #4
    Sencha User
    Join Date
    May 2011
    Posts
    14
    Vote Rating
    1
    Decoy Deluxe is on a distinguished road

      0  

    Default


    Addition for anyone who cares:
    Code:
    record.data.B = 'world'
    Works for my purposes, without triggering A's convert function