Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
185
rated 0 times [  189] [ 4]  / answers: 1 / hits: 18335  / 14 Years ago, sun, july 4, 2010, 12:00:00

My problem now is trying to send the ID (editable: false) of a row when editing that row.



For example, i have a grid with columns userid(editable: false), username(editable: true), firstname(editable: true), lastname(editable: true). When editing the row the grid is only sending the parameters username, firstname and lastname. In the server side i need the userid to know to which user i've tu apply those new values.



the editUrl looks like:



editurl : CONTEXT_PATH+'/ajax/admin/savePart.do?category=1',


Thanks



This is the full code:



$.jgrid.useJSON = true;
//http://www.trirand.com/jqgridwiki/doku.php?id=wiki%3Acommon_rules
$(document).ready(function() {
//alert(CONTEXT_PATH);
var lastsel;
jQuery(#rowed3).jqGrid(
{
url : CONTEXT_PATH+'/ajax/getPartesByCategory.do?catid=<s:property value=categoryId />',
//url : '/autoWEB/text.html',
datatype: json,
ajaxGridOptions: { contentType: application/json },
jsonReader : {
root: rows,
page: page,
total: total,
records: records,
repeatitems: false
},
headertitles: true,
colNames : [ 'ID', 'Pieza', 'Disponible'],
colModel : [ {
name : 'piezaId',
index : 'piezaId',
align : right,
width : 50,
editable : false,
required : true
}, {
name : 'descripcion',
index : 'descripcion',
width : 390,
editable : true,
required : true
}, {
name : 'disponible',
index : 'disponible',
width : 80,
editable : true,
edittype : 'select',
editoptions:{value:0:No;1:Si},
required : true
} ],
rowNum : 20,
rowList : [ 20, 40, 60, 80 ],
pager : '#prowed3',
sortname : 'piezaId',
postData: {piezaId : lastsel},
mtype:POST,
viewrecords : true,
sortorder : desc,
onSelectRow : function(id) {
if (id && id !== lastsel) {
jQuery('#rowed3').jqGrid('restoreRow', lastsel);
jQuery('#rowed3').jqGrid('editRow', id, true);
lastsel = id;
}
},
editurl : CONTEXT_PATH+'/ajax/admin/savePieza.do?categoria=<s:property value=categoryId />',
caption : Piezas
});
jQuery(#rowed3).jqGrid('navGrid', #prowed3, {
edit : false,
add : false,
del : false
});
})

More From » jquery

 Answers
20

You can use



hidden: true, editable: true, editrules: { edithidden: false }, hidedlg: true


in the definition of the piezaId (ID) column. The parameter hidedlg is currently not real needed, but can be useful if you decide the use other jqGrid features.


[#96334] Thursday, July 1, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
beatriceisabelad

Total Points: 710
Total Questions: 107
Total Answers: 99

Location: Cayman Islands
Member since Sat, Sep 17, 2022
2 Years ago
beatriceisabelad questions
Fri, Apr 2, 21, 00:00, 3 Years ago
Fri, Jun 19, 20, 00:00, 4 Years ago
Tue, Dec 3, 19, 00:00, 5 Years ago
Wed, Oct 16, 19, 00:00, 5 Years ago
;