Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Using a different jquery CSS for jqGrid
07/10/2009
14:56
Avatar
superjedi
Guest
Guests

Hello everyone,

For many reasons most people might find great that jqGrid now uses jquery's themes but I'd like to use a different color scheme for jqGrid than the one I use for jquery widgets.

Does anyone know a clean and easy way to achieve this ?

Thanks a lot,

08/10/2009
01:48
Avatar
Rumen[Trirand]
Moderator
Members

Moderators
Forum Posts: 81
Member Since:
08/10/2009
sp_UserOfflineSmall Offline

Hard to achieve, since the grid now uses the very same names of the CSS classes ThemeRoller uses and they are global for the whole page.

It might be possible to just copy paste a ThemeRoller theme and modify it manually to match selectors only the grid uses, have not tried that myself, but it might be a good idea [since this would also mean you could have two grids with different themes on the same page]. I will experiment a bit and let you know.

Another idea (kinda of a hack) would be to just place the grid inside an <iframe> where the CSS scope is different, but this could be messy in most cases.

Trirand ASP.NET WebForms & MVC components based on jQuery & ThemeRoller

http://www.trirand.net

08/10/2009
03:28
Avatar
superjedi
Guest
Guests

Thanks Rumen for replying so quickly,

I've already thought about the iframe hack, though it's psychologically hard to accept to regress so much considering that the application I'm working on is totally web 3.0 ready 😉

A good option for jqGrid would be the possibility to use of an arbitrary prefix for CSS selectors names, it'd be then easy to write a script that would quickly rename themeroller's CSS selector names to add this prefix.

Frederic

08/10/2009
03:57
Avatar
Rumen[Trirand]
Moderator
Members

Moderators
Forum Posts: 81
Member Since:
08/10/2009
sp_UserOfflineSmall Offline

Yes, definitely, we will research this asap and try to figure out a way to do it. This will provide two features - jqGrid with different theme than the rest of ThemeRoller components AND the possibility to have several grids with different themes on the same page.

I will followup here when we find the best solution.

Trirand ASP.NET WebForms & MVC components based on jQuery & ThemeRoller

http://www.trirand.net

08/10/2009
04:04
Avatar
superjedi
Guest
Guests

Nevermind, I've found a solution:

Open the themeroller css you want to use with your grid

Replace all occurences of

, .ui-

with

, #testcss .ui-

And all lines beginning with

.ui-

with

#testcss .ui-

Using the vim editor this can be easily achieved with the two commands:

:%s%, .ui-%, #testcss .ui-%g

:%s%^.ui%#testcss .ui

Once this is done, just put the grid inside <div id="testcss"></div> and you're done.

08/10/2009
04:08
Avatar
Rumen[Trirand]
Moderator
Members

Moderators
Forum Posts: 81
Member Since:
08/10/2009
sp_UserOfflineSmall Offline

Excellent, this is actually what I originally suggested but never tried

<quote>

It might be possible to just copy paste a ThemeRoller theme and modify it manually to match selectors only the grid uses, have not tried that myself, but it might be a good idea [since this would also mean you could have two grids with different themes on the same page]. I will experiment a bit and let you know.

</quote>

I will make sure we have one example that covers this area. 

Thanks again for the superb feedback.

Trirand ASP.NET WebForms & MVC components based on jQuery & ThemeRoller

http://www.trirand.net

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
171 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information