jQuery UI Widgets › Forums › Grid › add a button to grid
Tagged: button column, buttonclick, grid button
This topic contains 3 replies, has 3 voices, and was last updated by shawn 10 years, 7 months ago.
-
Authoradd a button to grid Posts
-
I am creating a grid from json data.
I want to add a column to each row with a button in it.
I can create the button, but there is no text in it and I don’t know how to add a function to the button.this is my code:
var cgiString="../cgi/t3query.exe?"+dataString var data = { datatype: "json", datafields: [ { name: 'category'}, { name: 'custID'}, { name: 'assignedTo'}, { name: 'openDate'}, { name: 'qStatus'}, { name: 'problem'}, { name: 'tNumber'}, ], id: 'id', url: cgiString }; $("#qResults").jqxGrid({ width: '835px', height: '300px',theme:'darkblue'}); $("#qResults").jqxGrid( { source: data, theme: 'darkblue', columns: [ { text: 'ticket#', datafield: 'tNumber', width: 60}, { text: 'customer ID', datafield: 'custID', width: 100 }, { text: 'problem', datafield: 'problem', width: 250 }, { text: 'assigned', datafield: 'assignedTo', width: 80 }, { text: 'date', datafield: 'openDate', width: 100 }, { text: 'status', datafield: 'qStatus', width: 55 }, { text: 'category', datafield: 'category', width: 100 }, { text: 'action', columntype: 'button', type: 'bool', cellsrenderer: function (row,column,value){ //do something on click }} ] });My grid looks like this:

when the user clicks the button, I need to get the value of that row’s “ticket” column cell to pass to a function
Hi shawn,
It’s demonstrated here – http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/popupediting.htm?arctic
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi shawn,
You can use
buttonclick: function (row).
Look at this demo for example.Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comthank you
-
AuthorPosts
You must be logged in to reply to this topic.