Forum


15:58

02/04/2009

I cant get search events like onInitializeSearch og afterShowSearch working. I try to use a datepicker in the search form. I use the search button in the navigator and have configured it like this.
{
sopt:['cn','bw','eq','ne','lt','gt','ew'],
onInitializeSearch : function(id) {
//alert('jad');
$("#sval".id).datepicker({
showOn: 'focus'
});
}
} // search options );
I use jqgrid 3.4.3 and I read that this should work as from 3.4.
I just started using this so I'm no expert and was wonder if I'm using it right.
kritro
02:20

Moderators
30/10/2007

Hello,
I think it should be:
$(”#sval”).datepicker({...});
The .id is not needed, but you will have datepicker every time click in this field, instead that you select another. If you have only one field to search this is ok, but it will make some confusions if you serarch on more than one field.
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.
03:49

02/04/2009

Thanks for the reply!
I know this would be a problem, but I was planning to if I could solve this some way or another, but maby its not possible.
The problem now is that the event is not triggered at all. If I do an alert
onInitializeSearch : function() {
alert('jad');
}
nothing happens when running the search form.
Is there maby another way to make it possible to search on date field with datepicker. Maby I can make my own search form for this.
06:50

Moderators
30/10/2007

Hello,
Which version do you use? There was a bug in previous versions. Use the last stable
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.
02:49

Moderators
30/10/2007

Hello,
I consider this to be included in 3.5 version
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.
tony said:
Hello,
Which version do you use? There was a bug in previous versions. Use the last stable
Regards
Tony
I use the last stable (3.4.3) and the usage of three event callbacks is impossible due to, AFAIU, a bug in grid.formedit.js:
if ( $.isFunction('onInitializeSearch') ) { p.onInitializeSearch( $("#srchcnt"+gID) ); };
if ( $.isFunction('beforeShowSearch') ) { p.beforeShowSearch($("#srchcnt"+gID)); };
if($.isFunction('afterShowSearch')) { p.afterShowSearch($("#srchcnt"+gID)); }
These checks always fail... Must have been
if ( $.isFunction(p.onInitializeSearch) )
etc... Correct?
08:08

Moderators
30/10/2007

Hello snobo,
Thanks for this. Fixed.
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.
Most Users Ever Online: 715
Currently Online:
174 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