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
Adding buttons to a field
21/05/2009
11:24
Avatar
bluehat
Member
Members
Forum Posts: 12
Member Since:
24/04/2009
sp_UserOfflineSmall Offline

I was wondering how I'd go about adding a field to each row of data that contained a button.  I'm trying to create an order system where I can click a button in a row and have it added to another grid on the same page.

I know there was a demo for adding buttons to each row but I can't seem to find it.

And as far as part two, is it possible to click a row button in one grid and add it to an 'order grid' on the same page?

Thanks.

25/05/2009
02:28
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

You vcan use custom formatter for this purpose. Note that in 3.5 the custom formatter is changed.

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.

28/05/2009
09:02
Avatar
scavanger
Member
Members
Forum Posts: 13
Member Since:
22/05/2009
sp_UserOfflineSmall Offline

Hi,

Im also interested in adding a field to each row that contains a button that calls an onclick that calls a javascript function.  I am having a hard time figuring out how to add the button to the field, I am using 3.5 beta and I tried following the custom edit example as a guide from the 3.5 demo and firebug just kept returning errors.

I was wondering if anyone might have done something like this and had an example of adding a button to a field, that i might be able to look at.

Thank you so much in advance for any help anyone can give.

31/05/2009
11:08
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

We already have edittype button and you can use dataInit or dataEvents in editoptions. Also refer to Changes.txt how to implement this.

Best 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.

24/06/2009
13:27
Avatar
kenstone
New Member
Members
Forum Posts: 2
Member Since:
09/06/2009
sp_UserOfflineSmall Offline

Can someone provide an example of how to do this? I'm missing how to define where the button is.

27/06/2009
10:53
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Using custom formatter

mybuttonadd = function(cellvalue, opt, roawdata) {

var mybutton = "<input type='button' onclick='myfunc("+opt.rowId+")' value='clickme' />";

return cellval+mybutton; // or mybutton+cellvalue

}

function myfunc(id)

{

alert(id);

}

then you can in colModel  - formatter: mybuttonadd

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:
52 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