Forum
11:10
13/01/2012
I think there's a bug. I used the jqGrid 4.2.1, but the problem is in the version 4.3.1, too.
I have a filterToolbar with a select item. I have 3 types of status:
name: Open
value: 38
name: Closed
value: 39
name: Other
value: 40
I have set the colMod like this:
colModel: [ ...
{
name: 'status',
label: 'Stato',
width: 90,
stype: 'select',
searchoptions: { value: {'null':'','38':'Open','39':'Closed','40':'Other'} , defaultValue: '38' }
},
I initialize the value associative array with the couples value-name, like in the wiki guide "If set as object it should be defined as pair name:value. editoptions:{value:{1:'One',2:'Two'}}" (Attention, maybe the problem is here, in the initialization of the select input. cause the documentation says name:value, but in the example there's value:name. However I follow the example, and it shows the select ok).
And it creates this, that is ok, the default value is selected correctly when the page is open.
<select id="gs_status" style="width: 100%;" name="status">
<option value="null"></option>
<option value="38">Open</option>
<option value="39">Closed</option>
<option value="40">Other</option>
</select>
But when I click the refresh button there's a problem.
I checked the code, refresh method call the clearToolbar() that it controls all the toolbar columns.
When it has to check the select input it does this (I debug my case):
$("#gs_"+$.jgrid.jqID(this.name)+" option",(this.frozen===true && $t.p.frozenColumns === true) ? $t.grid.fhDiv : $t.grid.hDiv).each(function (i){
if(i===0) { this.selected = true; }
if ($(this).text() == v) { //this is wrong, because in my case $(this).text is equal to 'Open' and v is equal to '38'. so the 'if' always fails!! and it does not update the selected item correctly.
this.selected = true;
v1 = $(this).val();
return false;
}
});
if I change, in jquery.jqGrid.src.js file (cause I used this file in my project), the line code
line 3529: if ($(this).text() == v) {
to this
line 3529: if ($(this).val() == v) {
It works well, the if condition is correct and it does what it has to do.
Is that a bug right?
Bye
Scevra
13:12
Moderators
30/10/2007
Hello,
Thanks. The bug is fixed in GitHub.
The documentation is corrected too.
If you find any other place into the documentation that is not correct written, please feel free to correct it.
I always read what is corrected into the docs.
Thank you
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.
Most Users Ever Online: 715
Currently Online:
38 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