Hi, I've searched the forum but couldn't find any related problem so I hope somebody knows how to help me out.
I've been using inline editing with a custom save button for quite a while now. Everything works fine, except for one thing. When I save my records (I just a custom script) I use the following:
jQuery("#grid").jqGrid('saveRow', recordId, false);
jQuery("#grid").jqGrid('restoreRow', recordId);
This saves the changes succesfully and restores the records to their 'native' looks (so no input forms). However, the last record that gets saved is highlighted and cannot be edited again by clicking on it untill I've clicked another record first.
This is my entire jqGrid script (excluding the custom save functions):
var editValue;
jQuery(document).ready(function(){
jQuery('#Tarieven-Ben').jqGrid({
hidegrid: false,
width: 1810,
height: 220,
xmlReader: {
root: 'Grid',
row: 'Rij',
page: 'Grid>Pagina',
total: 'Grid>Paginas',
records: 'Grid>Records',
repeatitems: false,
id: 'SOID'
},
url: 'functions/jqGridUpdate.php?bronXml=simonlies-test&queryId=0&sqlTeller=0&bronXml=simonlies-test',
datatype: 'xml',
mtype: 'GET',
colNames: ['ID', 'Volg', 'Provider', 'Abonnement', 'Act', 'Netw', 'Categorie', 'Type', 'Mi', 'Sm', 'Mm', 'Cm', 'BuiMin', 'BuiSMS', 'BuiMMS', 'Loopt', 'HBH', 'Takt', 'Start', 'Entree', 'Kosten', 'Acties', 'Opmerkingen'],
colModel: [
{name: 'SOID', index: 'SOID', width: 30, editable: false, editoptions:{readonly:false}},
{name: 'Volgnummer', index: 'Volgnummer', width: 40, editable: true, editoptions:{readonly:false}},
{name: 'Provider', index: 'Provider', width: 55, editable: true, editoptions:{readonly:false}},
{name: 'Abonnement', index: 'Abonnement', width: 140, editable: true, editoptions:{readonly:false}},
{name: 'Actief', index: 'Actief', width: 30, edittype: 'checkbox',editable: true, editoptions:{readonly:false, value: '1:0'}},
{name: 'Netwerk', index: 'Netwerk', width: 50, editable: true, editoptions:{readonly:false}},
{name: 'Categorie', index: 'Categorie', width: 65, editable: true, editoptions:{readonly:false}},
{name: 'Type', index: 'Type', width: 125, edittype: 'select',editable: true, editoptions:{readonly:false, value:':;Actiebundel:Actiebundel;Basis:Basis;Databundel:Databundel;SMS bundel:SMS bundel;SMS verdubbelaar:SMS verdubbelaar;Voordeelbundel:Voordeelbundel'}},
{name: 'AantalMin', index: 'AantalMin', width: 35, editable: true, editoptions:{readonly:false}},
{name: 'AantalSMS', index: 'AantalSMS', width: 35, editable: true, editoptions:{readonly:false}},
{name: 'AantalMMS', index: 'AantalMMS', width: 35, editable: true, editoptions:{readonly:false}},
{name: 'Cummulatief', index: 'Cummulatief', width: 30, editable: true, editoptions:{readonly:false}},
{name: 'KostenBuiMin', index: 'KostenBuiMin', width: 40, editable: true, editoptions:{readonly:false}},
{name: 'KostenBuiSMS', index: 'KostenBuiSMS', width: 40, editable: true, editoptions:{readonly:false}},
{name: 'KostenBuiMMS', index: 'KostenBuiMMS', width: 45, editable: true, editoptions:{readonly:false}},
{name: 'Looptijden', index: 'Looptijden', width: 40, editable: true, editoptions:{readonly:false}},
{name: 'Houdbaarheid', index: 'Houdbaarheid', width: 30, editable: true, editoptions:{readonly:false}},
{name: 'Takt', index: 'Takt', width: 40, editable: true, editoptions:{readonly:false}},
{name: 'Starttarief', index: 'Starttarief', width: 40, editable: true, editoptions:{readonly:false}},
{name: 'Entree', index: 'Entree', width: 50, editable: true, editoptions:{readonly:false}},
{name: 'Kosten', index: 'Kosten', width: 50, editable: true, editoptions:{readonly:false}},
{name: 'Acties', index: 'Acties', width: 150, edittype: 'textarea',editable: true, editoptions:{readonly:false}},
{name: 'Opmerkingen', index: 'Opmerkingen', width: 150, edittype: 'textarea',editable: true, editoptions:{readonly:false}}
],
onSelectRow: function(id){
if(id && id!==editValue){
jQuery('#Tarieven-Ben').jqGrid('editRow', id, true);
editValue=id;
}
},
pager: '#SO-Ben',
rowNum: 10,
rowList: [10, 20, 30],
sortname: 'SOID',
sortorder: 'ASC',
viewrecords: true,
caption: 'SimOnlyTarieven',
queryId: '0',
editurl: 'functions/formSave.php?bronXml=simonlies-test&spreadsheet=1&queryId=0&Naam=Tarieven-Ben'
});
Any help would be greatly appreciated.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top