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_Related Related Topics sp_TopicIcon
Add your own custom buttons to a form edit dialog page
31/05/2011
02:24
Avatar
nickelj
Member
Members
Forum Posts: 28
Member Since:
15/10/2010
sp_UserOfflineSmall Offline

Hi,

Is there someway to add your own buttons to a form edit dialog page beside either the next/previous navigation buttons or beside the submit/cancel buttons?

I would like a button that allows the user to print an envelope while a customer record is displayed in the Form Edit dialog

I do know I can add my own buttons to the bottom of the grid - it would be nice to do it on the Form Edit too.

Thanks!

Jim

25/06/2011
21:03
Avatar
Nathan
Member
Members
Forum Posts: 37
Member Since:
20/03/2009
sp_UserOfflineSmall Offline

Hi:

You can do this and here's the steps for how got it working.

1.  Clone the submit or cancel button

var clone = $('#sData').clone();

2.  Change the properties of the clone element

change the id :clone.attr('id','btn_something_unique');

change the name : clone.attr('name','btn_something_unique');

3.  Insert the  clone after the element you want:

clone.insertAfter('#SOME_CONTROL');

4.  I use UI button so add that to the button created:

$("#btn_something_unique").button({

label :"something"

}).click(function(){

//what the button needs to do

});

5.  Because the UI button adds some extra classes we should remove them so the buttons look the same

$('#btn_something_unique').removeClass('ui-button ui-widget ui-button-text-icon-primary');

That should get you going.

25/06/2011
21:13
Avatar
nickelj
Member
Members
Forum Posts: 28
Member Since:
15/10/2010
sp_UserOfflineSmall Offline

Thanks so much for your reply!

Where in the jqgrid code would you put this clone code?

In the beforeshowform?

Jim

26/06/2011
03:13
Avatar
Nathan
Member
Members
Forum Posts: 37
Member Since:
20/03/2009
sp_UserOfflineSmall Offline

I put the code in the onInitializeForm method.

N

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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