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 fill a select in editing form with a query
10/10/2010
16:32
Avatar
bogoa666
Malaga (Spain)
Member
Members
Forum Posts: 21
Member Since:
23/09/2010
sp_UserOfflineSmall Offline

Hi, i have two tables and one of them depends of the other. So, when I want to add or edit a row of the second table, I need to fill a select with a query where the result are the diffents rows of the first table. Is it possible?

Thanks

13/10/2010
19:07
Avatar
whoknows
Member
Members
Forum Posts: 4
Member Since:
27/09/2010
sp_UserOfflineSmall Offline

Hi,

I have exactly the same problem, so if you find the answer let me know about it :).

14/10/2010
00:30
Avatar
bogoa666
Malaga (Spain)
Member
Members
Forum Posts: 21
Member Since:
23/09/2010
sp_UserOfflineSmall Offline

it's work!!!

The solution is to use de dataUrl option in editoptions of colModel

jquery code:

colModel :[{name:'notification', index:'notification', width:110, align:'center', editable:true, edittype:'select', editoptions:{dataUrl:'/application/getNotificationSelect'}, searchoptions: { sopt: ['eq'], value:"true:Yes;false:No" }, stype: 'select'}]

server code:

public static void getNotificationSelect(){  
        String xml = "<select><option value='true'>Yes</option><option value='false'>No</option></select>";
        renderXml(xml);          
}

You only have to change the xml with other which was generated with your query items. This is only an example.

Note: renderXml(String xml) is a method of playframework which is the framework I use but you can use the same mothod to load the rows in the grid.

14/10/2010
10:05
Avatar
whoknows
Member
Members
Forum Posts: 4
Member Since:
27/09/2010
sp_UserOfflineSmall Offline

Nice !

Thanks a lot :).

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
68 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