Forum


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.
02:28

Moderators
30/10/2007

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.
09:02

22/05/2009

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.
11:08

Moderators
30/10/2007

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.
10:53

Moderators
30/10/2007

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.
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66