问题描述:

I'm using jqgrid to load data from MS Sql Server using asp classic.

I correctly visualize all my record and by using #pager can add and edit them.

I cannot use delete because when I click on that button and the pop-up opens, I can't pass parameter (id_city): this is my big problem. It's not displaying any error message.

I try to post some code (I don't know how to format it):

$(document).ready(function(){

$("#list").jqGrid({

url:'loadxml.asp', //this execute a stored procedure and create a xml document

datatype: 'xml',

mtype: 'GET',

colNames:["id_city","name_city"],

colModel :[

{name:'id_city', index:'id_city',editable:true, width:100,reloadAfterSubmit: true},

{name:'name_city', editable:true,reloadAfterSubmit: true,index:'name_city',width:300, reloadAfterSubmit: true,closeAfterAdd:true,reloadAfterSubmit:true}

],

height:600,

rowNum:50,

pager : '#pager',

viewrecords: false,

imgpath: 'css/ui-lightness/images',

loadonce: false,

xmlReader: {

root : "NewDataSet",

row: "Table",

repeatitems: false,

id: "id_city"

},

sortorder: "name_city",

caption:'summary',

editurl:"edit.asp" // here there is a select case... I can't pass id_city to delete

});

jQuery("#list").jqGrid('navGrid','#pager',{edit:true,add:true,del:true,search:false,refresh:false});

$('#pager_center').empty(); // workaround to see only <edit>,<add>,<delete> buttons

});

网友答案:

Add following line before colModel.

prmNames: {id: "id_city"},
相关阅读:
Top