PDA

View Full Version : FiltersFeature styles do not work in prodution application



jgrocha
28 Feb 2015, 1:19 PM
Hi,

I'm using Ext.ux.grid.FiltersFeature in a Ext 4.2 application.

Using it outside my application, the CSS works as expected, using the CSS classes defined in GridFilters.css, as we can see in http://docs.sencha.com/extjs/4.2.0/extjs-build/examples/grid-filtering/grid-filter-local.html
(http://docs.sencha.com/extjs/4.2.0/extjs-build/examples/grid-filtering/grid-filter-local.html)
But in my application, the styles are never rendered properly. The class ux-filtered-column is injected as expected, by the styles are not applied, because there is a previous font property assigned to x-column-header.

When I check the differences between my application and the mentioned example, the only difference is the order of ux-filtered-column and x-column-header. In my generated CSS, the x-column-header appears before ux-filtered-column.

I did the following tests:
* Put the GridFilters.css styles in sass/etc/all.scss


.ux-filtered-column {
font-style: italic;
font-weight: bold;
}
.ux-gridfilter-text-icon {
background-image: url(images/find.png) !important;
}


* Put the style files in index.html before <!-- <x-compile> -->


<link rel="stylesheet" href="resources/css/GridFilters.css">
<link rel="stylesheet" href="resources/css/RangeMenu.css">

* Added !important to the rules.

Nothing works. The headers never get rendered properly.

Some help is appreciated. Thanks.

joel.watson
6 Mar 2015, 6:43 AM
Hi--

Which version of Ext JS 4.2 are you using? And do the styles work while you are in development, but not in production, or both (I couldn't quite tell from your comments).

Thanks!
Joel

jgrocha
12 Mar 2015, 2:11 PM
Hi,

I'm using ExtJs 4.2.1.883. I'm using sencha app build to generate the production version.

I'm not able to use different index.html files for both the development version and the production version. The development index.html version is copied to the build folder.The application is available as open source at GitHub (https://github.com/jgrocha/geopublic/tree/master/client/GeoPublic).

I'm including the CSS both in the development and prodution version with:

<!-- <x-compile> -->
<!-- <x-bootstrap> -->
<link rel="stylesheet" href="bootstrap.css">

bootstrap.css contains one line with:

@import 'build/production/GeoPublic/resources/GeoPublic-all.css';

My custom CSS is written on sass/etc/all.scss. It only takes effect after building the application.

So, I don't see the FiltersFeature CSS both in development and production mode, simply because I don't know how to deal with different CSS for development and production (my ignorance!). It would be nice not to build the application for every CSS change.

On projects not generated by sencha command tool, the FiltersFeature CSS works (as in the provided examples).

Thanks!

joel.watson
12 Mar 2015, 2:28 PM
Hi--

Hmm, I'm not sure. I tried a fresh app with filters features (using Sencha Cmd), and it seems to work fine in both dev and production. Do you have a production version of the app that's publicly viewable?

Thanks
Joel

jgrocha
12 Mar 2015, 3:39 PM
Hi,

To see the difference between the development and prodution versions, I've reverted manually the bootstrap.css file from:

@import 'build/production/GeoPublic/resources/GeoPublic-all.css';
to:

@import 'ext/packages/ext-theme-neptune/build/resources/ext-theme-neptune-all.css';

Then, building the application again created a working css. I don't know exactly what happened, but the problem is solved.

Thanks Joel for you feedback.

joel.watson
13 Mar 2015, 4:07 AM
Hi,

To see the difference between the development and prodution versions, I've reverted manually the bootstrap.css file from:

@import 'build/production/GeoPublic/resources/GeoPublic-all.css';
to:

@import 'ext/packages/ext-theme-neptune/build/resources/ext-theme-neptune-all.css';

Then, building the application again created a working css. I don't know exactly what happened, but the problem is solved.

Thanks Joel for you feedback.

Awesome, glad it's working!
Joel