Forum


02:05

27/05/2009

Been searching the forum and found one suggestion to use the berforeSelectRow event but it does not work correctly.
beforeSelectRow: function(id){
rowdata = $('#grid').getRowData(id);
//alert(rowdata['value']);
updateSubMilestone(rowdata['value']);
return true;
}
function updateSubMilestone(val) {
// set options here based on val
jQuery('#grid').setColProp('field1', {editoptions: {value:options}});
}
It works to some extent, but it is one step behind, ie when I click a row it does not get populated until i click a new row! So the options are always for the previous row.
Are there any other events I could use?
04:40

Moderators
30/10/2007

Hello,
Could you please post the rest of code where you edit the cell?
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.
01:42

27/05/2009

Hi,
this is rest of the code:
var lastsel;
function checksave(result) {
if (result.status != 200) {
alert(result.statusText);
alert('Update failed!');
return false;
}
return true;
}
and event for grid:
onSelectRow: function(id){
if(id && id!==lastsel){
jQuery('#grid').restoreRow(lastsel);
lastsel=id;
}
jQuery('#grid').editRow(id,true,pickdates,checksave);
}
04:46

Moderators
30/10/2007

HEllo,
Sorry to ask you again - which version? (if this is a 3.4.x I see something that I do not like - also if this is the case could you please try with the last 3.5 beta?)
Reagrds
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.
03:49

27/05/2009

just now tried 3.5, but i can't get access to the grid? it's greyed out like when you open a modal dialog. data and everything is fine.
I already use UI and have modified some bits so I don't really want to download a new version. I also see that I have no borders around the cells in the grid and also the Loading information is on top of the grid and not in the middle like in the 3.5 demos.
09:09

Moderators
30/10/2007

Hello,
We all have problems with the time.
Could you please get the setted values before to call editRow
I mean
onSelectRow: function(id){
if(id && id!==lastsel){
jQuery('#grid').restoreRow(lastsel);
lastsel=id;
}
var selparams = $("#mygrid").getColProp('field1');
jQuery('#grid').editRow(id,true,pickdates,checksave);
See what values you have in editoptions
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.
02:26

27/05/2009

hi,
think i found something, probably not jqgrid related?
i use getJSON to populate the editoptions like this:
$.getJSON('getLibraryValues.do?', {libraryType: 'WO_ICC_MILESTONE', superiorOrder: val },
function(j) {
var options = ':;';
for (var i = 0; i < j.length; i++) {
options += j[i].optionValueParents + ':' + j[i].optionDisplayParents + ';';
}
options = options.slice(0,-1);
$('#wogrid').setColProp('woMilestoneSubMilestoneId', {editoptions:{value:options}});
// here options in grid are correct!!
})
// but here outside JSON function options are wrong.
Is there another way I have to do this?
02:03

Moderators
30/10/2007

Hello,
Aha - you made ajax request, and this request delayed the setting. Also try with async:false in the ajax call.
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:
97 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