Forum


01:30

24/06/2009

I used jqgrid advanced search feature. The meaning of the default string in odata is not clear enough for some scientific data.
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', ...]
So I like to customized some of the string, e.g. change 'less' -> 'lower', and 'greater' to 'higher',
but the change will be on one column only.
I tried two ways so far, but have not got a solution.
Way 1: the odata will apply to all the columns in the grid.
jQuery().ready(function (){
$.extend($.jgrid.search,{Find:"Filter Results…", caption:"Filter Results…", odata:[...,'lower', 'lower and equal', 'higher', ...]});
…
}
Way 2, only the sopt part works.
colModel:[
...
<ww:elseif test="name == 'RESOLUTION'">
, searchoptions:{sopt:['eq','ne','lt','le','gt','ge'], odata:['equal', 'not equal','lower', 'lower and equal', 'higher','higher and equal']}
</ww:elseif>
…
]
Any help? Thanks a lot.
09:38

Moderators
30/10/2007

Hello,
Thanks. This is a bug. Fixed.
Best 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.
22:13

24/06/2009

Thank you for the fixing. I tried with a new download of jqgrid version 3.6.5, which seems having the code fixing. But I still could not get my requirement worked.
Since I only want to customize the text in the drop down box for one column, could the code be something like,
colModel:[
...
<ww:elseif test="name == 'RESOLUTION'">
, searchoptions:{sopt:['lt','le','gt','ge'], odata:['lower', 'lower and equal', 'higher','higher and equal']}
</ww:elseif>
…
]
I did not see error, but still the default odata was displayed for resolution column. Any part not right?
Thanks a lot!
12:41

Moderators
30/10/2007

Hello,
The correct way is not to set the odata in the search options, but translate the whole array like this:
Suppose the odata has definition
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
then after loading jqgrid files
$.jgrid.odata = ['...here your translations ]
I see this is not very good solution, but any way I should save the existing users.
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.
14:54

13/05/2010

betty said:
I used jqgrid advanced search feature. The meaning of the default string in odata is not clear enough for some scientific data.
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', ...]
So I like to customized some of the string, e.g. change 'less' -> 'lower', and 'greater' to 'higher',
but the change will be on one column only.I tried two ways so far, but have not got a solution.
Way 1: the odata will apply to all the columns in the grid.
jQuery().ready(function (){
$.extend($.jgrid.search,{Find:"Filter Results…", caption:"Filter Results…", odata:[...,'lower', 'lower and equal', 'higher', ...]});
…
}
Way 2, only the sopt part works.
colModel:[
...
<ww:elseif test="name == 'RESOLUTION'">
, searchoptions:{sopt:['eq','ne','lt','le','gt','ge'], odata:['equal', 'not equal','lower', 'lower and equal', 'higher','higher and equal']}
</ww:elseif>…
]
Any help? Thanks a lot.
hi betty!
i am from brazil, i don´t speak english, but i think that i understanded your problem:
Please, see this code:
<head>
<script type="text/javascript">
function MudaLabbelGrid(){
$.jgrid.search = {
caption: "Pesquisa Nota",
Find: "Pesquisar",
Reset: "Limpar",
odata : ['Igual']
};
$.extend($.jgrid.search,{Find:'Pesquisar'});
}
</script>
</head>
<body onload="MudaLabbelGrid()" >
</body>
i hope that help you!
Most Users Ever Online: 715
Currently Online:
137 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