Hybrid View

  1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    2
    Vote Rating
    0
    hu2008yinxiang is on a distinguished road

      0  

    Default New Feacure Request: Auto Load Style Sheet

    New Feacure Request: Auto Load Style Sheet


    I'm a Chinese Student, and I have learned Ext JS for several month.(Sorry about my poor english.)

    As we know some user Extensions need extra css file, like the Ext.ux.statusbar.StatusBar, but the problem is that the Ext.Loader just load the javascript file, and we must add the statusbar.css by hand and hard-coded the html file. I'm sure there is a pretty solution to make our Compent Class more SMART, more SEPERATE.
    • SMART
    when the Component Class is loaded, the other resources(css etc.)will be auto load correctly.
    • SEPERATE
    we no longer need to write code to load the resources, and no hard-coded issue.

    I add some code to the end of Ext.ux.statusbar.StatusBar.js to do the primary try:
    Code:
    (function() {
        // 自动加载样式
        var me_path = Ext.Loader.classNameToFilePathMap['Ext.ux.statusbar.StatusBar'];
        me_path = me_path.substring(0, me_path.indexOf('StatusBar.js'));
        var css_el = {
            tag : 'link',
            rel : 'stylesheet',
            type : 'text/css',
            charset : 'UTF-8',
            href : me_path + 'css/statusbar.css'
        }
        Ext.DomHelper.append(document.head, css_el);
    })();


    and I think it will be a good feature if it become true.

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,770
    Vote Rating
    165
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    The CSS should be loaded for that class in the framework today. Are you using Sencha Cmd to build your app? Or if not does your index page link to ext-all.css?

  3. #3
    Sencha User
    Join Date
    Mar 2013
    Posts
    2
    Vote Rating
    0
    hu2008yinxiang is on a distinguished road

      0  

    Default


    Quote Originally Posted by slemmon View Post
    The CSS should be loaded for that class in the framework today. Are you using Sencha Cmd to build your app? Or if not does your index page link to ext-all.css?
    not the ext-all.css , it's the user extensions' css file matter

Thread Participants: 1

Tags for this Thread

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