Forum
04:01
15/10/2010
Hi,
If I have a database field that is a enum("Y","N") field. If I leave the edittype as a text field, then I can use the Nav buttons to go to the next and previous records in a modal form without any problem.
However, if I use a edittype as a select, then the Nav buttons cause the "Data has changed" to popup even when I haven't changed anything. The correct information is displayed in both cases.
So....this works (the "Data changed" does NOT popup):
{name:'author', index:'author', width:50, align:'center', editable:true, edittype:'text'}
This does not work (the "Data changed" DOES popup):
{name:'author', index:'author', width:50, align:'center', editable:true, edittype:'select', editoptions:{value:{Y:'Yes',N:'No'}}}
Thanks,
Jim
21:11
15/10/2010
I figured out that you are comparing the Text instead of the value.
My understanding of a Select is that you should be comparing against the value - the text part is only for display purposes. Also...I do receive the correct value back for updates etc...so you must be returning the value part of the select statement there.
I am sure you have a reason for doing the comparison against the text, but I fixed my problem by changing this in grid.formedit.js - code starts at line 378
case "select-one":
postdata[this.name]= $("option:selected",this).val();
extpost[this.name]= $("option:selected",this).val();
// original code extpost[this.name]= $("option:selected",this).text();
break;
By the way...it would be super cool to at least get some acknowldgement that you have read this, even if I am wrong....I have yet to receive any response on any of my posts from you. Glad I haven't bought the PHP addon.
Jim
19:14
Moderators
30/10/2007
Hello,
We compare the values betwen the grid and those in form select. In grid we always have Text and not Values.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
01:05
15/10/2010
Thank you for the response!
If you only have Text in the Grid, then we should be comparing Text against Text and not Text against Value.
However, I think in the grid, the displayed items are whatever I return in the SQL. So....for a Select in a Form, it should be comparing against the Value I put in the Select and not against the Text. Anyway...my code above works for me. If you decide to not change your code, then I can always just make the change everytime I download a new version.
It just doesn't seem logical to me.
Jim
Most Users Ever Online: 715
Currently Online:
23 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