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
Need help searching on initial grid load
03/06/2010
20:39
Avatar
Romanp
Member
Members
Forum Posts: 7
Member Since:
19/05/2010
sp_UserOfflineSmall Offline

Hello,

I'm using version 3.6.5 and the new API, and can't seem to figure out how to get the grid to apply the defval parameter when it first loads.  I am using an external select list and filtermodel (which work great), but can't figure out how to trigger a search on initial load.  If I set a breakpoint in Firebug, it all works well, but without the breakpoint, nothing happens.

I guess I'm looking for 2 things: 

Explanation of why it works with the breakpoint and not without

A workaround to trigger the search on initial load.

Roman

04/06/2010
19:18
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Maybe it depends where you call the search dialog.

Also this should work:

$("#grid").jqGrid({

...

});

$("#grid").jqGrid('searchGrid');

If you call the last code somehere when the grid is not already constructed you can use setTimeout function

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.

04/06/2010
21:24
Avatar
Romanp
Member
Members
Forum Posts: 7
Member Since:
19/05/2010
sp_UserOfflineSmall Offline

Hi Tony,

Thanks for the prompt reply, but I think I explained myself badly.   I don't want to use the search dialog, but want to drive all search parameters from the values in a select box.   I found in the end that I can set the 'search' grid parameter and add a value for the 'Status' field (see bold text below). By doing this I can get the grid to load only the data I want by default and then the user can use the dropdown list to refine what they see later.  Let me know if doing this is not supported or likely to break in future versions.

Thanks again,

Roman

 grid.jqGrid({
            colNames: ['Transaction Number', 'Status', 'Created By', 'Created On'],
            colModel: [{ name: 'TransactionNumber', index: 'TransactionNumber', width: 200 },
                       { name: 'Status', index: 'Status', width: 100 },
                       { name: 'CreatedBy', index: 'CreatedBy', width: 250 },
                       { name: 'CreatedOn', index: 'CreatedOn', width: 175 },
                      ],
            pager: pager,
            sortname: 'CreatedOn',
            rowNum: 10,
            rowList: [10, 20, 50],
            sortorder: "desc",
            url: "/Portal/Queue/Transactions",
            filterToolbar: true,
            ondblClickRow: ShowTransactionDetails,
            search: true,
            postData: { Status: 'CreatedOn > 5/1/2010 AND Status == InProgress' }

        }),
        grid.jqGrid('navGrid', '#pager', { edit: false,
                                           add: false,
                                           del: false,
                                           search: false,
                                           refreshstate: "current"
                                         }),
        search.jqGrid('filterGrid', "#grid", {
            gridModel: false,
            autosearch: true,
            filterModel: [{
                label: 'Order Status:',
                name: 'Status',
                stype: 'select',
                defval: 'InProgress',
                surl: '/Portal/Queue/SearchFilter'
            }]
          })
       }

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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