Reputation: 11
I have been trying to create a cellwidget button within gridx that once clicked it will call a javascript function externally. so the set up is i have the file test.html which contains a gridx grid with the following field declared in html
{ field: 'action',
name:'action',
widgetsInCell: true,
navigable: true,
width : '5%',
class:'linkButton',
decorator: function(){
return '<button class="linkButton" baseClass="linkButton" data-dojo-type="dijit.form.Button" iconClass="deleteButtonIcon"></button>'
},
setCellValue: function(gridData, storeData, cellWidget){
var status = cellWidget.cell.row.data()[3];
var id = cellWidget.cell.row.id;
if (status=='abc')
{
cellWidget.domNode.hidden=false;
if(cellWidget.btn._cnnt){
cellWidget.btn._cnnt.remove();
}
cellWidget.btn._cnnt = dojo.connect(cellWidget.btn, 'onClick', function(e){
alert('test');
deleteRecord('');
});
}
}}
The alert happens fine but the problem is that the deleteRecord function can not be found - this function is in a test.js file and is being loaded using the script tag
<script type="text/javascript" charset="utf-8" src="/test.js"></script>
i suppose my questions are
Upvotes: 1
Views: 68