1. #1
    Sencha Premium Member
    Join Date
    Nov 2010
    Location
    Pamplona - Spain
    Posts
    22
    Vote Rating
    0
    fmrc is on a distinguished road

      0  

    Default Unanswered: Load external URL, remove CSS, apply new CSS

    I'm trying to load posts from a blog into a panel, but the original styles are a mess. So I'd like to apply my own css. Is it possible?
    My code:
    showPost: function(list, index, element, record) {
    this.getBlog().push({
    xtype:'panel',
    title: record.get('title'),
    html: record.get('content'),
    scrollable: true,
    config:{
    // styleHtmlContent: true,
    cls: 'blogExt'
    }
    });
    },
    • styleHtmlContent set to true doesn't work, as it loads the blog styles,
    • styleHtmlContent set to false doesn't work either, as it removes the original style but doesn't allow further styling.
    Is there any work around? Thanks in advance.
    Fernando

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    38,530
    Vote Rating
    1114
    Answers
    3695
    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 config object should not be used when instantiating an instance, only within Ext.define
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Software Engineer
    ________________
    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 Premium Member
    Join Date
    Nov 2010
    Location
    Pamplona - Spain
    Posts
    22
    Vote Rating
    0
    fmrc is on a distinguished road

      0  

    Default I've already tried that

    Thank you, Mitchael. The fact is that I also tried it without config and it didn't work either. That was my last change and it was certainly a wrong try. If the problem is not in that, where is it?

    showPost: function(list, index, element, record) {
    this.getBlog().push({
    xtype:'panel',
    title: record.get('title'),
    html: record.get('content'),
    scrollable: true,
    styleHtmlContent: true, // true: applies web css styles - false: does not apply any style.
    cls: 'blogExt' // it's of no use

    });
    }

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    38,530
    Vote Rating
    1114
    Answers
    3695
    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

    Inspect the DOM. If the styles are inline then not much you can do. If the html comes with CSS then there is some you can do but the blogExt can now be used.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Software Engineer
    ________________
    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.

  5. #5
    Sencha Premium Member
    Join Date
    Nov 2010
    Location
    Pamplona - Spain
    Posts
    22
    Vote Rating
    0
    fmrc is on a distinguished road

      0  

    Default Right - there're embedded styles in the page

    You're right. There're too many elements with embedded styles (mainly a <iframe>) so that it's impossible to change the width attribute. It affects all the rest. Better to live in light of truth than pursue a phantom target. Thank you for your tips.
    Fernando

Thread Participants: 1

Tags for this Thread