Forum


02:25

08/11/2009

Hello,
I'm starting to work with jqGrid and i found something strange. I have my grid setup, data is coming in from the server (XML through jQuery Ajax load) and is displaying just fine. One of the columns is editable as a select. The values for this select are loaded as XML through the regular jQuery ajax call again. When clicking the cell, the select is showing just fine and i can select an option from it. After this my problem arises: no text is displayed after selecting the option. Any clues? Below is the source for the grid:
function loadPropertyDefinition(nodeType){
jQuery(”#list”).GridUnload();
jQuery(”#list”).jqGrid({
url:'nodeType.php?nodeType='+nodeType,
datatype: “xml”,
cellEdit: true,
xmlReader: {
root: “propertyDefinitions”,
row: “propertyDefinition”,
repeatitems: false,
id: “name”
},
colNames:['Name','Required data type', 'Multiple?', 'Fulltext searchable?'],
colModel:[
{name:'name', index:'name', width:130, xmlmap:"name", editable: true, edittype:"text"},
{name:'Required Type', index:'required_type', width:65, xmlmap:"required_type", editable: true, edittype:"select", editoptions: {value:gridPropertyTypeDefintionString}},
{name:'Multiple', index:'is_multiple', width:30, xmlmap:"is_multiple"},
{name:'Fulltext', index:'is_fulltextsearchable', width:30, xmlmap:"is_fulltextsearchable"}
],
cellsubmit: “clientArray”,
rowNum:10,
autowidth: true,
rowList:[10,20,30],
pager: jQuery('#pager'),
sortname: 'id',
editurl: “server.php”,
viewrecords: true,
sortorder: “desc”,
onSelectRow: function(id){
//jQuery('#list').editRow(id, true);
}
}).navGrid('#pager',{edit:true,add:true,del:true});
Thanks in advance,
Regards, Patrick
10:09

Moderators
30/10/2007

Hello,
In which browser. Do you use some modal widget? How and in which way do you call loadPropertyDefinition - is it a part from something else?
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:10

08/11/2009

Hi,
sorry for the incompleteness. Here's some additional information:
- This behaviour happens in IE as well as in Firefox
- I am not using any mordal widget in the page
- Before this method, an ajax call is made, which is getting an array with the different select options:
var gridPropertyTypeDefintionString= new Array();
$(document).ready(function(){
$.ajax({
type: "GET",
url: "propertyTypeDefinition.php",
dataType: "xml",
success: function(xmlString) {
$(xmlString).find("propertyTypeDefinition").each(function(){
var name = $(this).find("name").text();
var value = $(this).find("value").text();
gridPropertyTypeDefintionString[value] = name;
}); //close each
}
}); //close $.ajax(
});
The strange thing is that the values are in the selectbox displaying just fine, but when i change the option and move away by clicking outside the selectbox, there's nothing in the selected cell.
Regards,
Patrick
08:44

Moderators
30/10/2007

Hello,
Very strange.
I tested your example on my machine and everthing work ok. The only diffrence is that I have set the values in editoptions for the select manual without a function. Could you please test with the following settings:
....
{name:'Required Type', index:'required_type', width:65, xmlmap:"required_type", editable: true, edittype:"select", editoptions: {value:"1:one;2:two"}},
...
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:
72 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