Forum

November 2nd, 2014
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_TopicIcon
Inline edit select lists not working after upgrade to 3.5
27/08/2009
18:19
Avatar
Pete
Member
Members
Forum Posts: 100
Member Since:
01/09/2008
sp_UserOfflineSmall Offline

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

28/08/2009
12:40
Avatar
zerikv
Member
Members
Forum Posts: 9
Member Since:
12/06/2009
sp_UserOfflineSmall Offline

Hello phelgren,

I think you have missed the following fields in the configuration of the grid :

            cellEdit: true,
            cellsubmit: 'clientArray'

Regards

~~~

Eric

28/08/2009
16:35
Avatar
Pete
Member
Members
Forum Posts: 100
Member Since:
01/09/2008
sp_UserOfflineSmall Offline

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

28/08/2009
16:50
Avatar
Pete
Member
Members
Forum Posts: 100
Member Since:
01/09/2008
sp_UserOfflineSmall Offline

Hmm. Bummer. This has the side effect of disabling onSelectRow (as documented) which breaks the rest of the application.  This is an inlneEdit grid and I need the OnSelectRow.

Back to the drawing board.  Any other recommendations?

31/08/2009
06:16
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

09/09/2009
16:31
Avatar
Pete
Member
Members
Forum Posts: 100
Member Since:
01/09/2008
sp_UserOfflineSmall Offline

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

Forum Timezone: Europe/Sofia

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

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information