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
Example of jSon return string for formatter = select
29/07/2011
11:38
Avatar
Ken
Member
Members
Forum Posts: 5
Member Since:
28/07/2011
sp_UserOfflineSmall Offline

Hi guys

Could anyone please give me an example of the format required for the return jSon string if you have set formatter:'select' in the colModel.

Example:

 ,{name:'myColExample' ,index:'myColExample',width:50
                                                                     ,search:true ,editable:true, sortable:true
                                                                    ,edittype:'select' , formatter:'select',editrules: { required: true } ,editoptions: { }
                                                                    }

I am returning a jSon string as below which works fine but I just can not find any example of the required format for the select option.

Many thanks.

Example my current jSon format:

{"rows":[{"cell":[355.0,"Arzim, C","Expenses (T)","Legends","Legends","x2.33",8.78,12.0,245.4888],"id":3},{"cell":[1256.0,"Butt, N","Expenses (NT)","","NTFC","x1.5",12.8,6.0,115.2],"id":4},{"cell":[2179.0,"Feere, E","Expenses (T)","Legends","Legends","x1.5",8.95,26.57,356.70225],"id":5},{"cell":[1255.0,"Ferdinand, L","Expenses (T)","NTFC","NTFC","x2",12.5,3.8,95.0],"id":6},{"cell":[355.0,"Arzim, C","","Legends","NTFC","x1",8.78,5.2,45.656],"id":7}],"page":1,"records":5,"total":1,"userdata":{"temporary_total":858.0470499999999,"temporary_units":53.57,"temporary_hourly_rate":"Totals:"}}

31/07/2011
04:33
Avatar
Rukbat
USA
Member
Members
Forum Posts: 8
Member Since:
28/07/2011
sp_UserOfflineSmall Offline

If you just return an html select (<select><option value="the text">the text</option>…</select>) it should work – no JSON needed.

01/08/2011
15:38
Avatar
Ken
Member
Members
Forum Posts: 5
Member Since:
28/07/2011
sp_UserOfflineSmall Offline

Hi Rukbat

Many thanks for the reply.

Yes I already know how to return an HTML select but the jQgrid strips out any onselect javascript supplied with the HTML select.  This is the problem I am trying to overcome.

What I need is to find an example of how the formatter: 'select' expects a jSon string to format the required information, as per my post.

I know it must exist as the functionality tells me so…. only I can not find an example.

Regards

03/08/2011
17:39
Avatar
Rukbat
USA
Member
Members
Forum Posts: 8
Member Since:
28/07/2011
sp_UserOfflineSmall Offline

Read http://www.toknowmore.net/e/1/.....&nbsp; OnSelect is for text, box or arera.  Try onChange for dropdowns.  According to Firebug, that comes through if the server sends it as plain text - <select onChange="myFunction();"> etc.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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