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
How to: Hack-in jQuery UI-ThemeRoller support
01/03/2009
20:11
Avatar
StevenBlack
Member
Members
Forum Posts: 9
Member Since:
06/02/2009
sp_UserOfflineSmall Offline

I folks,

I just hacked-in ThemeRoller support for my jqGrids.  So I thought I would share this hoping it might help others.

Warning: the jqGrids I am developing right now have no footers.  IOW, I hide the whole area that says “Page 1 of NN” at the bottom.  So implementing that is up to you and the code below is a good starter.  The code below only applies to the grid title.  If I decide to hack column headers, I will add to this but, right now, I do not have the need to theme column headers.  Looks fine to me…

I am using the latest jQuery-UI 1.6R6 which will soon ship as jQuery-UI 1.7 and require jQuery 1.31 at minimum.

My current pages include the ThemeRoller switching tool and this seems to work fine on my themed jqGrids.

// As usual
$(”#MyTable”).jqGrid(…);

// theme support
$(”#MyTable”).addClass(”ui-widget”);
$(”table.Header th, .HeaderRight, .HeaderLeft”).css(”background-image”,”url()”).addClass(”ui-widget-header”).addClass(”ui-state-default”);

// This side-border suppression is necessary since the jqGrid title area is a composite and the jQuery UI themes place borders that do not look so good in this partucular context.
$(”td.HeaderRight”).css(”border-left”,”0px”);
$(”td.HeaderLeft”).css(”border-right”,”0px”);
$(”table.Header th”).css({borderLeft:”0px”, borderRight:”0px”});

I am pretty happy with the result on my limited and simple jqGrids and I hope this gets you started if you need ThemeRoller support for your jqGrids.

**–**  Steve

30/04/2009
15:42
Avatar
mainster
Member
Members
Forum Posts: 5
Member Since:
30/04/2009
sp_UserOfflineSmall Offline

Hi Steve,

That is excellent! I have only been working with jqGrid for a few days, and been trying hard to hack it to work nicely with jquery UI, as demonstrated here:

http://www.trirand.com/jqgrid3.....qgrid.html

Looks nice with your border hack, but I would really like a nice hack for the pager aw well! Currently the .ui-state-hover triggered on hovering the arrow icons, adds a border. I guess I should add a 1px border hidden for the ui-state-default?

I also have problems with the placement of the text and arrows, looking at Firebug, I can see the problem is that the containers are forced into dimension of width x 41 pixels. Is it eh background image from jquer-UI exanding them?

Not much of a CSS expert unfortunately... 🙁

Please give me some hints of what to do here 😉

Kristian

30/04/2009
16:33
Avatar
mainster
Member
Members
Forum Posts: 5
Member Since:
30/04/2009
sp_UserOfflineSmall Offline

So far, this is my solution for adjusting the Pager for themes:

.ui-jqgrid-title {
    font-size: 12px;
}

.ui-pg-button {
    border: 1px solid transparent;
}

table.ui-pg-table td,
table.ui-pg-table td span {
    border: 1px solid transparent !important;
    font-size:11px;
}

table.ui-pg-table input {
    font-size:12px !important;
    height:18px !important;
}

$("div#pager").removeClass("ui-jqgrid-pager");

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
23 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