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
beforeSearch not triggered
20/07/2009
10:13
Avatar
Renso
PA
Member
Members
Forum Posts: 118
Member Since:
11/09/2008
sp_UserOfflineSmall Offline

When I define the call-back for the beforeSearch event it does not fire when I define it as part of ym grid setup. It only fires when I define it via the filterGrid function, is that intentional or a bug?

My HTML:

<table id="List" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="ListPager" class="scroll" style="text-align:center;"></div>

My jqGrid definition:

$('#list').jqGrid({

...

            gridModel: true,
            gridNames: false,
            gridToolbar: true,
            autosearch: false,
            enableClear: true,
            enableSearch: true,
            toolbar: [true, "top"],

            beforeSearch: function() {

                  //some code - this does not get triggered!
            }

...

My filtergrid definition:

        $('#t_List')).filterGrid('#List', {
            gridModel: true
        });

Also, if during filterGrid I do not specify gridModel it throws an alert "filer is not set". Keep in mind if I did not specify the following properties during the grid setup it also does not work:

$('#list').jqGrid({

...

            gridModel: true,
            gridNames: false,
            gridToolbar: true,
            autosearch: false,
            enableClear: true,
            enableSearch: true,
            toolbar: [true, "top"],
...

Why is it required to define the above properties as well as using the filterGrid, should specifying the event cll-backs like beforeSearch not work if I specify them like this?

$('#list').jqGrid({

...

            gridModel: true,
            gridNames: false,
            gridToolbar: true,
            autosearch: false,
            enableClear: true,
            enableSearch: true,
            toolbar: [true, "top"],

            beforeSearch: function(){

                 //some code

           }

20/07/2009
10:24
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

http://www.secondpersonplural......0z66wb.htm

The most common mistake

Also you should set these parameters not to the grid, but to the filterGrid

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.

20/07/2009
10:46
Avatar
Renso
PA
Member
Members
Forum Posts: 118
Member Since:
11/09/2008
sp_UserOfflineSmall Offline

I just looked at the documentation and it seems it is a feature then Smile, just the way ti works.

Another question, in stead of manually specifying the

<div id="mysearch"></div>

I just specified toolbar:

[true, "top"],
as part of my grid setup, which automatically creates the search div for me, is this
wrong or OK to do (it works fine by the way); i.e. a good practice?
I then, when referencing the div simply do this:

$(item.replace('#', '#t_')).filterGrid....
(item = #grid_id)
22/07/2009
01:39
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Yes I think that this is correct.

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/12/2009
13:48
Avatar
matt_lethargic
Member
Members
Forum Posts: 3
Member Since:
17/09/2009
sp_UserOfflineSmall Offline

I cannot get beforeSearch to fire!

$('#personDataSearch').filterGrid('#personDataTable', {
            gridModel: true,
            gridNames: true,
            formtype: "vertical",
            enableSearch: true,
            enableClear: true,
            autosearch: false,
            afterSearch: this._SetProgressUIVisibility(false),
            beforeSearch: this._SetProgressUIVisibility(true)
        });

The afterSearch works fine! Anyone know why this is or what I've done wrong?!

HELP!

Just because I'm paranoid, doesn't mean they're not out to get me.

03/12/2009
13:22
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

What do the this._SetProgressUIVisibility(true) function?

Simple check is:

beforeSearch : function() {

alert("I'm lunched");

}

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
90 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