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
Customize advanced search "odata" on specified column
04/05/2010
01:30
Avatar
betty
Member
Members
Forum Posts: 22
Member Since:
24/06/2009
sp_UserOfflineSmall Offline

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.

04/05/2010
09:38
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

06/05/2010
22:13
Avatar
betty
Member
Members
Forum Posts: 22
Member Since:
24/06/2009
sp_UserOfflineSmall Offline

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/05/2010
12:41
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

13/05/2010
14:54
Avatar
kweles
Brazil
Member
Members
Forum Posts: 9
Member Since:
13/05/2010
sp_UserOfflineSmall Offline

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!

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information