Forum
Topic RSS
Related Topics
15:59
10/02/2010
OfflineHi, 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('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):
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.
14:02
Moderators
30/10/2007
OfflineHello,
One possible solution is to do resetSelection after restoring the row- which will clear the selection from the the row
...
$("#grid").jqGrid('resetSelection');
Best Regards
Tony
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.
13:29
10/02/2010
Offline18:13
Moderators
30/10/2007
OfflineHello,
Ah I see,
$("#grid").jqGrid('resetSelection');
editValue = null;
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: 994
Currently Online:
43 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
Log In
Home