Forum


22:47

23/09/2010

Hi, I have to fill a select with values dinamically. It's works with a select out of the jqgrid table but not when I try to add/edit a row in my table. I think the problem is de access to the form element but I don't know how to do it.
For example:
This is my column in the table:
{name:'dependence', index:'dependence', width:85, align:'center', editable:true, edittype:'select', search: false}
This is a select out of my jqgrid table:
<select name="test" id="test"></select>
This is my code event:
$.ajax({
url: '@{Application.getDependencesSelect()}', // Calling my server function
processData: false,
dataType: "application/xml",
success: function(data) {
var res = $(data).html();
$("#test").html(res); // it's works
$("select#dependence").html(res); // it's doesn't work
}
});
This is the server function code:
public static void getDependencesSelect(){
StringBuffer xml = new StringBuffer("<select><option value='1'>dependence1</option><option value='2'>dependence2</option></select>");
renderXml(xml.toString());
}
Regards, Adrian.
Most Users Ever Online: 715
Currently Online:
49 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