Forum
Once again a great job with the new 3.3 features! The issue I have is that I used navButtonAdd to add my add/hide culmns button that performs setColumns on cliick. But when the user clicks any of the other buttons, like edit a row, delete a row, the modal dialog for that comes up as well as the Show/Hide dialog for selecting which columns to display/hide. It also happens if I click on for example the edit button and have no row selected, in this case both dialogs also ppear, the one for selecting columns as well as the dialog that informs the user to select a row first. I am not sure if this is a bug. Seee my code exmaples below:
setting jqGrid:
loadComplete: function() {
$(item+'Pager .tbutton').click(function (){$(item).setColumns(); });
},
loadBeforeSend: null,
search: true,
searchdata: {},
.navGrid(item+'Pager',
{refresh: true, edit: true, add: true, del: true, search: true},
{}, // edit options
{}, // add options
{}, // del options
{} // search options
)
.navButtonAdd(item+'Pager',{caption:"",title:"Select Columns",buttonimg:jQueryImagePath+'/find.gif',position:'last',onClickButton:null}
);
Found my issue, the loadComplete function where the click event is set for the column set button is not unique:
$(item+'Pager .tbutton').click(function (){$(item).setColumns(); });
It targets all buttons (i.e. tbutton). Simply need to use a more unique selector:
$(item+'Pager td.nav-button[title="Select Columns"] .tbutton').click(function (){$(item).setColumns(); });
Can you add a way to add a class name (addClass) somehow to the navButtonAdd options, or is there a way for me to extend it so I can maybe added my own class name so it is easier to identify?
06:15
Moderators
30/10/2007
Hello,
Thank you for this - I think something similar, but your
recommendation is of course better.
(I need to identify these buttons too).
I will add a option for class for every custom button so that
we can easy identify it.
Thank you
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
44 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