1. #21
    Sencha - Ext JS Dev Team nohuhu's Avatar
    Join Date
    Jun 2011
    Location
    Redwood coast
    Posts
    246
    Vote Rating
    48
    nohuhu has a spectacular aura about nohuhu has a spectacular aura about nohuhu has a spectacular aura about

      1  

    Default


    Daniil,

    Is there any compelling reason to use prototype munging instead of the normal class inheritance model? I don't see any, and you shouldn't, too.

    Regards,
    Alex.

  2. #22
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    982
    Vote Rating
    115
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    Hi @nohuhu,

    I think it is my bad habit, thank you for pointing that out.

    You meant that I should write something like this:
    Code:
    Ext.chart.Chart.override({
        initComponent: function() {
            this.callParent();
            this.legend = Ext.create('Ext.ux.chart.SmartLegend', {
                position: 'right',
                chart: this,
                rebuild: true,
                boxStrokeWidth: 1
            });
        }
    });
    or create a new class inheriting from Chart, right?
    Object.NET
    Frameworks and Tools for .NET Developers
    --------------------------------------------------
    Ext.NET - Ext JS for ASP.NET - Examples | Twitter
    Bridge.NET - Launching Soon!
    --------------------------------------------------

  3. #23
    Sencha - Ext JS Dev Team nohuhu's Avatar
    Join Date
    Jun 2011
    Location
    Redwood coast
    Posts
    246
    Vote Rating
    48
    nohuhu has a spectacular aura about nohuhu has a spectacular aura about nohuhu has a spectacular aura about

      1  

    Default


    @Daniil,

    Not exactly. To override a stock class, use Ext.define instead:

    PHP Code:
    Ext.define('MyOverrides.chart.Chart', {
        
    override'Ext.chart.Chart',
        ...
    }); 
    This will allow you to take advantage of the class system, dynamic loading and Sencha Cmd build process. However, the preferred way to reuse the code is class inheritance. See my Stackoverflow answer for more explanations.

    Regards,
    Alex.

  4. #24
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    982
    Vote Rating
    115
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    Oh, I see the Ext.Base.override method is marked as deprecated. Thank you, Alex.

    Also thank you for the Stackoverflow link. It was worth to read!
    Object.NET
    Frameworks and Tools for .NET Developers
    --------------------------------------------------
    Ext.NET - Ext JS for ASP.NET - Examples | Twitter
    Bridge.NET - Launching Soon!
    --------------------------------------------------

  5. #25
    Sencha User
    Join Date
    Jun 2013
    Posts
    1
    Vote Rating
    0
    dedarshan is on a distinguished road

      0  

    Default IE 11 issue for Smart LEgend

    IE 11 issue for Smart LEgend


    Hi, I have implemented smart legend in ext.net mvc application this legend does not get rendered fine in IE 11.

    Any help would be gr8

    Please find the below image:

    snapshot.jpg