Forum



10:09

12/07/2010

Hi Tony,
is there any way to attach and fire a custom function on multiple records like delGridRow. Basically I want to activate or de-activate a set of selected users. SO right now ,i can get the list of selected row id's and am passing them to a customised delGridRow(which is not right). So what I have now is :
function funcDelUsers()
function funcActivateUsers()
function funcDectivateUsers()
and all of then are using the following piece of code with different values for caption,msg,bSubmit, url
var gr = jQuery("#usersList").jqGrid('getGridParam','selarrrow');
if( gr.length > 0 ) {
jQuery("#usersList").jqGrid('delGridRow',gr,{
reloadAfterSubmit: true,
caption: 'Activate users?', //note – caption is not changing according to task
mtype: 'post',
msg: 'Do you want to activate the selected users?', // msg is not changing according to function, is fixed to the value set in the function which is activated first
url: is different in different functions
……………………………………………..
So,instead of trying my way around delGridRow and try to customize it forother tasks , there should be basically two ways to
proceed and do the task cleanly.
1. attach a custom function to the jqgrid and cal it on the selected rows(do it the jqgrid way)
jQuery("#usersList").jqGrid('my_custom_function',gr,options};
my_custom_function perhaps does nothing,but it lets me access the jqgrid options,methods,events
Basically i should ave access to jqgrid options,methods,events inside the function and let jqgrid do the work with those options
2. get the row id,s by jQuery("#usersList").jqGrid('getGridParam','selarrrow') , write your own custom ajax code for activating/ deactivating the users by passing the id's to the server. reload the grid once we get response from the server.
I was wondering if there is any way to do it via way 1. It would be wonderful if you have any ideas to help me out.
Thank you.
Most Users Ever Online: 715
Currently Online:
56 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