Forum


11:38

28/07/2011

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:"}}
15:38

28/07/2011

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
17:39

28/07/2011

Read http://www.toknowmore.net/e/1/..... 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.
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66