Results 1 to 2 of 2

Thread: [4.2.1 beta] Should not Ext.destroy support destroying stores?

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-9630 in a recent build.
  1. #1
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    1,017
    Vote Rating
    125
      0  

    Default [4.2.1 beta] Should not Ext.destroy support destroying stores?

    REQUIRED INFORMATION

    Ext version tested:

    • Ext 4.2.1 beta

    Browser versions tested against:
    • Any

    DOCTYPE tested against:
    • Any

    Description:
    • Should not Ext.destroy support destroying stores? Currently, it just calls a Store's "destroy" CRUD action. It is all due to the fact that actual destroying method has been renamed to "destroyStore" since ExtJS 3.

    Steps to reproduce the problem:
    • Just run the script

    The result that was expected:
    • The store is buried

    The result that occurs instead:
    • The store lives and makes its "destroy" CRUD action

    Test Case:

    Code:
    var store = Ext.create("Ext.data.Store", {
        fields: [],
        proxy: {
            type: "ajax",
            url: "some URL"
        }
    })
    
    Ext.destroy(store)

    HELPFUL INFORMATION

    Possible fix:


    Code:
    Ext.destroy = function () {
        var ln = arguments.length,
            i, arg;
    
        for (i = 0; i < ln; i++) {
            arg = arguments[i];
            if (arg) {
                if (Ext.isArray(arg)) {
                    this.destroy.apply(this, arg);
                } else if (Ext.isFunction(arg.destroyStore)) {
                    arg.destroyStore();
                } else if (Ext.isFunction(arg.destroy)) {
                    arg.destroy();
                } else if (arg.dom) {
                    arg.remove();
                }
            }
        }
    };
    Object.NET
    Frameworks and Tools for .NET Developers
    --------------------------------------------------
    Ext.NET - Ext JS for ASP.NET - Examples | Twitter
    Bridge.NET - Write C#. Run JavaScript! - Live | Twitter
    --------------------------------------------------

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,154
    Vote Rating
    249
      0  

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

Posting Permissions

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