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_TopicIcon
Passing additional parameters with inline delete action
07/10/2014
21:00
Avatar
melchoir55
Member
Members
Forum Posts: 3
Member Since:
25/09/2014
sp_UserOfflineSmall Offline

I have a jqgrid with an inline delete button. This button sends a post to a php file which would, in turn, go delete the record from the database. Unfortunately, I cannot seem to figure out how to send additional data with the post call. I don't want to rely on the row number. Rather, I wish to add the value from a column (childId) to the POST. Can someone recommend how to send, for example, the value of the childId cell for the deleted row along with the post?

Here is my table:

jQuery("#team").jqGrid({
url: 'TeamRetrieval.php?userId='+userId,
datatype: "json",
colNames: ['User Id', 'Email', 'Created', 'Delete'],
colModel: [
{name: 'childId', index: 'childId', align: 'center', sorttype: 'string'},
{name: 'user_email', index: 'user_email', align: 'center', sorttype: 'string'},
{name: 'user_registered', index: 'user_registered', align: 'center', sorttype: 'string'},
{ name: 'delete', formatter: 'actions', width: 40, align:'center', sortable: false,
formatoptions:{
keys: true,
editbutton: false,
editformbutton: false,
delbutton: true,
delOptions: { url: 'TeamRetrieval.php?userId='+userId}
}
}
],
mtype: "GET",
sortorder: 'asc',
sortname: 'childId',
caption: "Existing Team Members",
});
15/10/2014
08:27
Avatar
melchoir55
Member
Members
Forum Posts: 3
Member Since:
25/09/2014
sp_UserOfflineSmall Offline

Is this not getting attention because it is impossible, or against best practice for jqgrid? If so, I would appreciate someone posting to let me know. It seems very fragile to me to base deletion actions on row numbers which could conceivably change between the time the table is rendered and the time the deletion request occurs. As such, I'd like to identify the record by a column value rather than row number.

21/10/2014
17:13
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Sorry for delay. It seemes I have missed this post.

 

1. If you want to send only the childId you can just this field to be a rowid.

 

This can be easy achieved if you set key:true in colModel like this

 

colModel: [
{name: 'childId', index: 'childId', align: 'center', sorttype: 'string', key:true},

2. Another solution In delete options is to use onclickSubmit event which should return object with the desired data which then will be passed to the post. See here

 

Regards

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.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information