jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Grid columntype button call Javascript function with "buttonclick"
Tagged: #jqwidgets-grid, grid, javascript grid, jquery grid
This topic contains 3 replies, has 3 voices, and was last updated by Marina 6 years, 8 months ago.
-
Author
-
October 4, 2018 at 12:47 pm Grid columntype button call Javascript function with "buttonclick" #102284
Hi I have created a column with columntype button within my grid row and I want to have it dispatch or call a function in my javascript file on buttonclick. Is this possible?
October 4, 2018 at 1:35 pm Grid columntype button call Javascript function with "buttonclick" #102285Here is the sample of my code:
$(“#savedFcstPopGrid”).jqxGrid(
{
width: 780,
sortable: false,
autoheight: true,
showfilterrow: false,
filterable: false,
rowsheight: 20,
columnsheight: 30,
selectionmode: “none”,
// enablemousewheel: false,
// scrollmode: “deferred”,
theme: “prio_grid”,
altrows: true,
source: dataAdapter,
// height: 60 + (20 * data.length),
columns: [
{text: ‘Forecast Id’, datafield: ‘fcstId’, hidden: true},
{text: ‘Name’, datafield: ‘fcstName’, width: 160},
{text: ‘(Content)<br/>Modified Date<br/>MM/DD/YYYY’, datafield: ‘modifiedDate’, width: 120},
{text: ‘Last<br/>Submitted<br/>MM/DD/YYYY’, datafield: ‘submittedDt’, width: 120},
{text: ‘Lead’, datafield: ‘fcstLead’, cellsalign: ‘right’, width: 100},
{text: ‘Finalized’, datafield: ‘fcstFinalized’, cellsalign: ‘right’, width: 100},
{text: ‘Comment’, datafield: ‘fcstComment’, cellsalign: ‘right’, width: 120},
{
text: ”, columntype: ‘button’, width: 60, datafield: ‘Show’, value: ‘Show’, cellsrenderer: function () {
return “Show”;
},
// buttonclick: this.openFcst($(‘#savedFcstPopGrid’).jqxGrid(‘getrowdata’, $(this).jqxGrid(‘getGridParam’, ‘selrow’)))
buttonclick: function (row) {
this.dispatch(‘showSavedFcst’, [$(‘#savedFcstPopGrid’).jqxGrid(‘getrowdata’, row)]);
}
}
]
});October 8, 2018 at 10:04 am Grid columntype button call Javascript function with "buttonclick" #102314Hello andrewspak,
With the implementation of the “buttonclick” callback which requires the
columntype: 'button'
.
Please, take a look at this demo, it demonstrates how to use it:
https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/popupediting.htm?light
It looks like you create your own logic to ‘dispatch’ specific information.
Is there any error message? Or something else?
Please, provide us with more details about what you want to achieve.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comOctober 25, 2018 at 6:20 pm Grid columntype button call Javascript function with "buttonclick" #102519How dynamically to hide buttons on some rows based on row data? I have implemented delete button, but i need to show it only on rows with specific data for some properties of the datarecord of this row.
-
AuthorPosts
You must be logged in to reply to this topic.