Forum


04:02

19/05/2010

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.
05:50

15/10/2010

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
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66