Forum


02:42

13/06/2009

I am still using the version 3.1. I could setup to edit rows through the grid but I could not setup the deleting feature.
I am pasting my codes here. Please tell me what changes needed to make the delete row feature work.
news.asp
<script type="text/javascript">
var lastsel;
$(function() {
$("#list").jqGrid({
url: '/FLPM/cp/news.cs.asp?Process=ViewNews',
datatype: 'xml',
mtype: 'Get',
height: '100%',
colNames: ['Actions','ID #','Title', 'Category Name', 'Active', 'Date Entered'],
colModel: [
{name:'Actions', index:'Actions', width:100, sortable:false, search:false},
{name:'ID', index:'ID', width:30},
{name:'Title', index:'Title', width:360},
{name:'Category', index:'Category', width:115},
{name:'Active', index:'Active', width:40, editable:true, edittype:"select", editoptions:{value:"1:Yes;0:No"}},
{name:'Date', index:'Date', width:126},
],
pager: jQuery('#pager'),
rowNum: 10,
rowList: [10,20,30],
sortname: 'Date',
sortorder: 'desc',
viewrecords: true,
imgpath: 'js/jqGrid/themes/basic/images',
onSelectRow: function(id) {
if(id && id!==lastsel) {
$('#list').restoreRow(lastsel);
$('#list').editRow(id,true);
lastsel=id;
}
},
loadComplete: function(){
var ids = jQuery("#list").getDataIDs();
for(var i=0;i<ids.length;i++){
var cl = ids[i];
de = "<input style='height:25px;width:25px;' type='button' value='DE' onclick=location.href='?Section=news&Process=EditNews&NEWSID="+cl+"'; />";
be = "<input style='height:25px;width:25px;' type='button' value='E' onclick=jQuery('#list').editRow("+cl+"); ></ids>";
se = "<input style='height:25px;width:25px;' type='button' value='S' onclick=jQuery('#list').saveRow("+cl+"); />";
ce = "<input style='height:25px;width:25px;' type='button' value='C' onclick=jQuery('#list').restoreRow("+cl+"); />";
jQuery("#list").setRowData(ids[i],{Actions:de+be+se+ce})
}
},
editurl: "news.cs.asp?Process=EditQNews",
}).navGrid("#pager",{edit:true,add:false,del:true});
});
</script>
<table id="list" class="scroll"></table>
<div id="pager" class="scroll"></div>
news.cs.asp
Case "EditQNews"
NEWSID = Request.Form("ID")
ACTIVE = Request.Form("ACTIVE")
UCSQL = ("UPDATE NEWS SET NEWSACTIVE = '"& NEWSACTIVE &"' WHERE NEWSID = " & NEWSID & " ")
Set objUpdatenNews = objConn.execute(UCSQL)
Most Users Ever Online: 715
Currently Online:
63 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