I have a master js file ( say name : my-dataTables.js ) and accessing it from view (groovy) which is calling functions from my-dataTables.js.
proto.dataTable = {
'filterOptions': function( selectedFilter ) {
var dCodes = "" ;
var dCodes2 = "";
if ( selectedFilter == 'test1' )
{
dCodes = "something 1";
dCodes2 = "something 2";
}
else
{
dCodes = "something 2";
dCodes2 = "something 1";
}
return {
'dCodes': dCodes,
'dCodes2': dCodes2
};
}
And to access them from view ( groovy):
$('#filter-status').change(function () {
var filterOptions = proto.dataTable.filterOptions($(this).find('option:selected').text());
var dCodes = filterOptions.dCodes;
var dCodes2 = filterOptions.dCodes2;
alert(dCodes + " isRegex : " + dCodes);
});
Working fine on IE, means “proto.dataTable.filterOptions” was called and returned expected value on IE. But on Firefox, it looks like that it reached $(‘#filter-status’).change(function () but not inside proto.dataTable.filterOptions(). And NO error message. Not sure what I am missing. Can any one help?
The code is fine. It was browser cache issue. I cleaned up the cache and the code worked as expected.