Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Jun 2008
    Posts
    5
    Vote Rating
    0
    buronix is on a distinguished road

      0  

    Exclamation Ext.clone bug with firefox [firefox bug not expected by extjs]

    Ext.clone bug with firefox [firefox bug not expected by extjs]


    Sorry for the previous bad bug report.

    Ext version tested:
    • Ext 4.0.7
    Browser versions tested against:
    • Firefox 10.0.2 (Unix)
    Description:
    • With a kind of Extjs own created object (I tested it with a Ext.data.Model record), when
      Ext.clone executed
      var type = toString.call(item);
      The type of the record is and Ext.clone not clone the object and return the original item.
    • it is a Firefox bug: [https://bugzilla.mozilla.org/show_bug.cgi?id=684601]

    Steps to reproduce the problem:
    • Create an Ext object ( I tested with Ext.data.Model) and debug with toString.call(obj)

    The result that was expected:
    • [object Object]

    The result that occurs instead:
    • [xpconnect wrapped native prototype]
    Possible fix:

    var type = Object.prototype.toString.call(item);

    Operating System:
    • Unix
    ------------
    Rubén Burón Rodrigo.
    StackOps Developer.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,620
    Vote Rating
    817
    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


    So you tried Ext.clone on a record?
    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
    Jun 2008
    Posts
    5
    Vote Rating
    0
    buronix is on a distinguished road

      0  

    Post


    Quote Originally Posted by mitchellsimoens View Post
    So you tried Ext.clone on a record?
    I only tried, I needed to clone the data of an array of records without the references, but when I see the code of clone, I realized I need to copy the data, not clone it.

    Finally I use other method to "clone"(copy) the data of an array of records:

    PHP Code:
    /**
    * function to return a copy of the records without references
    *@param records[] array of records to copy
    *@return newData[] the array with the copy of the records
    */
    copyRecords     :       function(records){
           var 
    newData   =  []
           
    Ext.Array.each(records,function(recordi)
           {
                   
    newData[i]     =    {};
                   
    record.fields.each(function(item,index)
                   {
                             
    newData[i][item.name]    =    record.get(item.name);
                   });
           }
           return 
    newData;

    But if you create a Model manually you can check the bug with the example.

Thread Participants: 1

Tags for this Thread