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
Cancel A Form Load
07/06/2009
22:33
Avatar
Nathan
Member
Members
Forum Posts: 37
Member Since:
20/03/2009
sp_UserOfflineSmall Offline

Hi,

Quick question which I just can't seem to wrap my head around solving.

I have a combo-box above my grid control that needs to be populated before add/edit/del is clicked in the grid navigation bar.

I need to be able to cancel the load event and post a dialog indicating that they choose a value first.  This would be similar to the "Select a row" dialog that occurs now but instead of requiring a row it would require a combo box outside the dialog box to not be null.

Any suggestions on where to do this ? I'm currently using the beforeShowForm event to load a number of selects which depend on the non-grid related select having a non-null value.

Nathan

09/06/2009
07:51
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Not sure, but I think it is better to use navButtonAdd and when the user click the icon for add/edit etc you should analyze the data and do what you want.

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.

09/06/2009
16:17
Avatar
Nathan
Member
Members
Forum Posts: 37
Member Since:
20/03/2009
sp_UserOfflineSmall Offline

Hi Tony, thanks for the post.

How do invoke the form load method with the form automatically created by the colmodel with the parameters listed in the navGrid definition. 

Alternatively, is it possible to add a buttonclick event to one of the predefined buttons?

Here's my working example with the conditions checking removed so the code is more readable:

jQuery(grid).navButtonAdd(nav,{buttonimg:"image.gif",caption:"Add",position:"first",title:"Add", onClickButton:function(){

    if(  CONDITIONS ARE RIGHT){
        //Load the form but how ?
    }else{

//Open a dialog to tell the user to select the necessary information first.

        jQuery(#myDialog).dialog('open);
    }
}   
});

12/06/2009
01:56
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

The same way as it is called in navGrid

  if(  CONDITIONS ARE RIGHT){
       var mygrid = $("#mygridid")

       var rowid = mygrid.getGridParam("selrow");

      if(rowid) mygrid.editGridRow(rowid, param_for_edit);
    }else{

//Open a dialog to tell the user to select the necessary information first.

        jQuery(#myDialog).dialog('open);
    }
}   
});

Also you can use editGridRow as separate method.

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/06/2009
21:25
Avatar
Nathan
Member
Members
Forum Posts: 37
Member Since:
20/03/2009
sp_UserOfflineSmall Offline

Thanks ! That worked great !

Nathan

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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