Forum

July 12th, 2025
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
Using Search criteria as default values
24/10/2010
22:53
Avatar
Reg
Calgary, Canada
Member
Members
Forum Posts: 92
Member Since:
06/06/2008
sp_UserOfflineSmall Offline

I want to default fields on new records to the values selected on the previous search so that, say, I search for Item = 'Hats', and whether I find any or not and the grid displays any or not, when I click on Add, the default for Item (a dropdown field on the edit form) is 'Hats'.

Is there a way to make this happen?

Thanks

Reg

25/10/2010
01:53
Avatar
Reg
Calgary, Canada
Member
Members
Forum Posts: 92
Member Since:
06/06/2008
sp_UserOfflineSmall Offline

I think I figured out most of this.

I retireve the search criteria like this: 

   beforeShowForm : function (formid) {
        var searchOptions = $("#postingtime").getGridParam("postData");
        if(searchOptions.item_fk == 0) {

             // suppress the edit form

          } else {

             // allow editing and set the default values

            $("#item_fk",formid).val(searchOptions.item_fk);

          };

What I haven't been able to figure out is how to suppress the edit form. return[false] doesn't do anything.

Am I going about this the best way? How can I prevent the form showing?

Thanks,

Reg

25/10/2010
19:17
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello Reg,

Currently this is not possible, but I think that this have sense and will try to realize it in the next release.

In the mean time you can not use the build in add/edit in navigator, but rather to add a custom button in navigator with add/edit and when using onClickButton option to use this logic for lunching or not the edit form

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.

26/10/2010
04:41
Avatar
Reg
Calgary, Canada
Member
Members
Forum Posts: 92
Member Since:
06/06/2008
sp_UserOfflineSmall Offline

Hello Tony,

What I am doing as a work-around is to disable all the fields on the form. It is not ideal, but it works and I will wait for you to release the next version with something that works better. I appreciate that very much.

Thanks

Reg

Forum Timezone: Europe/Sofia

Most Users Ever Online: 994

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