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_Related Related Topics sp_TopicIcon
Submit buttons in jqGrid - creating, disabling & enabling
22/05/2013
23:08
Avatar
steve_o
Member
Members
Forum Posts: 10
Member Since:
02/05/2013
sp_UserOfflineSmall Offline

I have been asked to put buttons inside a jqGrid, but they will not be used for editing the contents of the grid.  They will be a submit button that will sit at the end of each row, and will be greyed out/disabled until the onSelectRow fires.

Based on a couple examples I have found, I'm able to create the buttons as follows:

var ids = $("#myGrid").jqGrid("getDataIDs");

for (var i=0;i < ids.length;i++) {

var cl = ids[i];

sm = "<input style='height:25px;width:65px;' type='submit' value='Re-Send' onclick="$('#myGrid').editRow('"+cl+"');" />";

ca = "<input style='height:25px;width:55px;' type='button' value='Cancel' onclick="$('#myGrid').editRow('"+cl+"');" />";

$("#myGrid").jqGrid("setRowData",ids[i], {msgAct:sm+ca});

}

The text in red above I know won't be in my code, I'm only using it as a placeholder right now. Also, the code is in the loadComplete event.   The buttons are being created, but I'm lost as to how to disable them within the for loop.

What I need to do is the following:

  1. Once each of the 2 buttons (in the Action column) has been created, I need to disable both of them.  How do you do this inside the jqGrid programatically?  
  2. In the onSelectRow event I'll get the row data I need, and want the Re-Send & Cancel buttons to become active on that row only.  
  3. Within the onSelectRow event is where I will look for the click event for the two submit buttons for that row.  
  4. Until the row is selected, the buttons should be disabled.

Also, should the 2 buttons on each row be disabled in the loop, or after it finishes?  

Thanks!

23/05/2013
16:44
Avatar
steve_o
Member
Members
Forum Posts: 10
Member Since:
02/05/2013
sp_UserOfflineSmall Offline

Please disregard the post above.  

Asking a better question in a new post regarding some of the above.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 496

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