Forum

July 12th, 2025
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
Edit record directly after succesful save.
30/03/2010
15:59
Avatar
Seroczynski
The Netherlands
Member
Members
Forum Posts: 17
Member Since:
10/02/2010
sp_UserOfflineSmall Offline

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.

03/04/2010
14:02
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

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.

06/04/2010
13:29
Avatar
Seroczynski
The Netherlands
Member
Members
Forum Posts: 17
Member Since:
10/02/2010
sp_UserOfflineSmall Offline

Thanks Tony, your help is appreciated. However, the row loses it's selection but the problem still exists.

06/04/2010
18:13
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

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.

07/04/2010
13:48
Avatar
Seroczynski
The Netherlands
Member
Members
Forum Posts: 17
Member Since:
10/02/2010
sp_UserOfflineSmall Offline

Hey Tony,

Thanks! Your solution fixed my problem.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information