Forum
21:00
25/09/2014
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:
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",
});
08:27
25/09/2014
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.
17:13
Moderators
30/10/2007
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.
Most Users Ever Online: 715
Currently Online:
61 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