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
Modifying the Title Bar
21/05/2010
00:12
Avatar
squid
Member
Members
Forum Posts: 36
Member Since:
19/05/2010
sp_UserOfflineSmall Offline

Is there any way to add an icon to the title bar of the grid (right after the minimize icon).  I was looking at the code and found the place where it is created.  Seems very elaborate so I was just wondering if anyone else had already attempted this.

21/05/2010
04:02
Avatar
squid
Member
Members
Forum Posts: 36
Member Since:
19/05/2010
sp_UserOfflineSmall Offline

Well, I plowed my way through the code and decided that, for now, the best way I could insert a new button into the title bar is as follows:

temp = $("<a href='#' role='link' style='right: 16px;'/>")

.addClass('ui-jqgrid-titlebar-close HeaderButton')

.hover(

function() {$(this).addClass('ui-state-hover');},

function() {$(this).removeClass('ui-state-hover');}

).append ("<span class='ui-icon ui-icon-circle-close'></span>");

$('.ui-jqgrid-title').before (temp);

I haven't started adding a function to this new button, but it's going to be a close button because I made the jqGrid movable like a dialog.

26/10/2010
05:50
Avatar
nickelj
Member
Members
Forum Posts: 28
Member Since:
15/10/2010
sp_UserOfflineSmall Offline

Thanks so much!  Exactly what I needed too!

I made a extra icon beside some fields in a GridEdit that creates a "browse" popup that uses another jqGrid to display a list of possible selections (too many to use a standard select in the GridEdit – and besides, the select isn't searchable). Then the user can click on one and it puts that data back into the GridEdit form.

I just needed a close button so the user could close the browse window without making a selection.

Here is my adjusted code:

   temp = $("<a href='#' role='link' style='right: 16px;' onclick='window.parent.$.modal.close();'/>")
   .addClass('ui-jqgrid-titlebar-close HeaderButton')
   .hover(function() {$(this).addClass('ui-state-hover');},
   function() {$(this).removeClass('ui-state-hover');}
   ).append ("<span class='ui-icon ui-icon-circle-close'></span>");
   $('.ui-jqgrid-title').before (temp);

I used the SimpleModal plugin which is what the $.modal refers to. This popup was a IFRAME with the jqGrid displayed inside it, so it has to go to the parent document in order to close as that is where it was created.

So cool!  Thanks again!

Jim

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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