Hi,
You need the CellWidget-module of gridx:
{moduleClass:"gridx/modules/CellWidget"},
After that you need to define the Button in the column-JSON:
{field:'colButtons', width:'80px', widgetsInCell: true, decorator: function(){return "<button data-dojo-type='dijit.form.Button' data-dojo-attach-point='btnDetails'></button>";}, setCellValue: function(gridData, storeData, cellWidget) { cellWidget.btnDetails.set('title', 'Details'); cellWidget.btnDetails.set('iconClass', 'detailsIcon'); cellWidget.btnDetails.set('showLabel', false); if(cellWidget.btnDetails._cnnt){cellWidget.btnDetails._cnnt.remove();} //remove all other callbacks cellWidget.btnDetails._cnnt = dojo.connect(cellWidget.btnDetails, 'onClick', function(e){alert(gridData);}); //create new onClick-Event }, },
- Log in to post comments