Forum
18:17
06/11/2008
First, thanks for the great plugin.
I like the toolbar feature and the examples I looked at used the following pattern:
$('#t_list').append('<html here>')
which did work for me.
I prefer adding HTML to the toolbar using a templating language.
This can be accomplished in jqGrid by applying this patch (jqGrid 3.3; Date: 2008-10-05 rev 62)
It worked for me on FF3 on Mac.
Sample usage to add '<div id="toolbar">good stuff here</div>':
jQuery('#list').jqGrid({
<other params here>
toolbar: ['#toolbar', "bottom"]
});
Is there an easier way to use an existing div as a toolbar?
Thanks
alvin
--- a/jqGrid/js/grid.base.js
+++ b/jqGrid/js/grid.base.js
@@ -1366,7 +1369,8 @@ $.fn.jqGrid = function( p ) {
$(grid.cDiv).append("<table class='Header' cellspacing='0' cellpadding='0' border='0'><tr><td class='HeaderLeft'><i
$(grid.cDiv).insertBefore(grid.hDiv);
if( ts.p.toolbar[0] ) {
- grid.uDiv = document.createElement("div");
+ if( ts.p.toolbar[0] === true) {grid.uDiv = document.createElement("div");}
+ else {grid.uDiv = $(ts.p.toolbar[0]);}
if(ts.p.toolbar[1] == "top") {$(grid.uDiv).insertBefore(grid.hDiv);}
else {$(grid.uDiv).insertAfter(grid.hDiv);}
$(grid.uDiv,ts).width(grid.width).addClass("userdata").attr("id","t_"+this.id);
10:00
06/11/2008
One caveat: the div passed in to the toolbar is given the id='#t_list'
For example:
<div id='#will_be_renamed'><div id='#toolbar'>Some html</div></div>
jQuery('#list').jqGrid({
<other params>
toolbar: ['#will_be_renamed', 'top']
});
// Next javascript line will see:
jQuery('#t_list') // instead of '#will_be_renamed'
jQuery('#toolbar') // does work
Most Users Ever Online: 715
Currently Online:
58 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