Forum



15:38

10/02/2010

Hey Tony,
I'm unsure wether this is adressed before, but a few search queries on the forum lead to nothing so I'll give it a shot by creating a new topic.
I'm using inline edit and have a custom safe function. But that all aside, when I simple alert() (triggered by onclick on jqGrid) the value that jqGrid('getGridParam', 'selRow') returns I always notice it's the id of the previous record. The first record I click after the page finished loading I get NULL as an result. This troubles me when I try to save my records.
If addition information is needed I'll post when asked. Thanks in advance.
21:35

Moderators
30/10/2007

Hello,
Yes it will be good to post the code. Actually it depends where you call jqGrid('getGridParam', 'selrow').
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.
12:31

10/02/2010

My jqGrid script:
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&queryId=0&sqlTeller=0&bronXml=simonlies',
datatype: 'xml',
mtype: 'GET',
colNames: ['ID', 'Volg', 'Provider'],
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}},
],
onSelectRow: function(id){
if(id && id!==editValue){
jQuery('#Tarieven-Ben').jqGrid('editRow', id, true);
editValue=id;
}
},
pager: '#SO-Ben',
rowNum: 50,
rowList: [10, 20, 30],
sortname: 'SOID',
sortorder: '',
viewrecords: true,
caption: 'SimOnlyTarieven',
queryId: '0',
editurl: 'functions/formSave.php?bronXml=simonlies&spreadsheet=1&queryId=0&Naam=Tarieven-Ben'
});
The identification of the grid:
Note the onclick event. Now this is what's behind that call:
var selected = jQuery("#" + grid).jqGrid('getGridParam', 'selrow');
if(jQuery.inArray(selected, recordsAangepast) == -1){
recordsAangepast[recordsTeller] = selected;
recordsTeller++;
}
};
Hope this helps.
18:42

Moderators
30/10/2007

Hello,
Right now I see. humm - Can not look at the code right now, but we bind a click to the table too.
Try this:
jQuery.jqGridChange = function(grid){
...
return false;
}
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.
11:47

10/02/2010

14:00

Moderators
30/10/2007

Hello
The problem is that your onclick fire first and then onSelectRow which selects the value.
You should maybe not use onclick event for the table, but rather to use the onselectRow to do this.
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.
Most Users Ever Online: 715
Currently Online:
56 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