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
how to modify a "select" in the add/edit form?
15/01/2011
22:47
Avatar
bogoa666
Malaga (Spain)
Member
Members
Forum Posts: 21
Member Since:
23/09/2010
sp_UserOfflineSmall Offline

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.

15/01/2011
23:34
Avatar
bogoa666
Malaga (Spain)
Member
Members
Forum Posts: 21
Member Since:
23/09/2010
sp_UserOfflineSmall Offline

I have resolved the problem by using firebug. 

$("#dependence") works fine xDDDDDD

Forum Timezone: Europe/Sofia

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

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information