Forum


18:19

01/09/2008

Been working on this all day and I can't figure out what the issue is. The grid populates and I can see the selection values being loaded from the server but clicking on the row only hightlights the row and the selects in the row don't generate. Almost like editing isn't active at all. All my grids are "broken" with this issue.
I looked at the upgrade information in the wiki and didn't see anything about this issue. Here is the code (FWIW):
// Load grid information
function loadProgramOptions(){
var colYesNo = {"value":{"":"Select","Y":"Yes","N":"No"}};
var jsonURL = '${.data_model.requestURI}?action=AjaxGetEmployeeProgramOptions&empid='+ $('#emplist').val();
$('#empProgramOpts').jqGrid({
url: jsonURL,
datatype: 'json',
height: 250,
colNames:['Program','Allow','Program Description'],
colModel:[
{name:'optionName',index:'optionName', width:200 },
{name:'optionDefault',index:'optionDefault', width:60, editable:true, edittype:'select', formatter:'select', editoptions:colYesNo},
{name:'optionDescription',index:'optionDescription', width:500 }
],
rowNum:10,
rowList:[10,20,30],
pager: $('#empProgramOptspager'),
sortname: 'optionName',
sortorder: "desc",
onSelectRow: function(id){
$('#empProgramOpts').editRow(id,true);
},
jsonReader: {repeatitems: false},
caption: "Maintain Program Options"
});
}
What did I miss when I upgraded to 3.5? Something simple I am sure! This all works in 3.4.4
16:35

01/09/2008

Thanks Eric! That seemed to fix the issue.
The REAL weirdness is that I built a local source of data (rather than used json) and cut and pasted the code into a new directory with a fresh copy of jqgrid so that it looked like this:
<script type="text/javascript">
// Load grid information
jQuery(document).ready(function(){
var colYesNo = {"value":{"Y":"Yes","N":"No"}};
var lastsel2;
var jsonURL = '${.data_model.requestURI}?action=AjaxGetEmployeeProgramOptions&empid='+ $('#emplist').val();
$('#empProgramOpts').jqGrid({
url: jsonURL,
datatype: "local",
height: 250,
colNames:['Program','Allow','Program Description'],
colModel:[
{name:'optionName',index:'optionName', width:200 },
{name:'optionDefault',index:'optionDefault', width:60, editable:true, edittype:'select', formatter:'select', editoptions:colYesNo},
{name:'optionDescription',index:'optionDescription', width:500 }
],
rowNum:10,
rowList:[10,20,30],
pager: $('#empProgramOptspager'),
sortname: 'optionName',
sortorder: "desc",
onSelectRow: function(id){
$('#empProgramOpts').saveRow(id);
$('#empProgramOpts').editRow(id,true);
},
jsonReader: {repeatitems: false},
caption: "Maintain Program Options"
});
var data = [
{"optionDefault":"N","optionDescription":"Allowed to Verify Absences","optionName":"VERIFY"},
{"optionDefault":"N","optionDescription":"Allowed to Post to the Intermediate file","optionName":"POSTINT"},
{"optionDefault":"N","optionDescription":"Allowed to Post to the Payroll File","optionName":"POSTPAYROLL"},
{"optionDefault":"N","optionDescription":"Allowed to Enter Substitutes for Absences","optionName":"SUBS"},
{"optionDefault":"Y","optionDescription":"Allowed to Use the Wizard to Create the Absences","optionName":"WIZARD"},
{"optionDefault":"N","optionDescription":"Allowed to use the Full Interactive Edit to add absences","optionName":"FULLEDIT"},
{"optionDefault":"Y","optionDescription":"Allowed to view Absence History","optionName":"ABSHISTORY"},
{"optionDefault":"Y","optionDescription":"Allowed to view unposted absences","optionName":"UNPOSTED"},
{"optionDefault":"Y","optionDescription":"Allowed to run reports","optionName":"REPORTS"}
];
for(var i=0;i<data.length;i++)
jQuery("#empProgramOpts").addRowData(data[i].id,data[i]);
});
</script>
And that WORKS in jqGrid 3.5.2 even without your additions. Must be something to do with the json data, one way or another.
Thanks! I can move forward again. I'll read up on the use of those fields.
Pete
06:16

Moderators
30/10/2007

Hello,
Could you please try this way:
... editoptins:{value:{"":"Select","Y":"Yes","N":"No"}}
direct in the colModel
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.
16:31

01/09/2008

Tony,
I am not sure what the issue was. I spent even more time fiddling with it because I'd rather be running the latest version of jqGrid. I am not sure if it was due to the MyEclipse IDE or Tomcat or just some funky glitch but I ended up deleting the stylesheet and script folders and then replacing them with what I thought were exact copies and then it started to work.
No real explaination (yet). If I run across it again I'll see if I can figure it out. But, for now, this is a non-issue. All seems to be running OK at the 3.5.2 level.
I did change my code to match what you posted and everything is still working OK.
Thanks,
Pete
Most Users Ever Online: 715
Currently Online:
36 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