I'm trying to bind click event to dynatable
generated, I've tried $('#my-final-table hr').on("click",function(){alert("foo");});
so I'm trying to bind it after loading data:
var jsondata=[
{
"band": "Weezer",
"song": "El Scorcho"
},
{
"band": "Chevelle",
"song": "Family System"
}
];
$('#my-final-table').dynatable({
dataset: {
records: jsondata
}
})
.bind('dynatable:afterProcess', function(){alert('foo')});
But it doesn't work, no alert is shown after loading. JSFiddle:http://jsfiddle.net/maysamsh/pDVvx/
try adding a parameter to your callback function
In the example from the dynatable website they manually call the
afterProcess
function the first time it runs. For your code that looks something like:If you want to see this in a fiddle, check here: http://jsfiddle.net/pDVvx/2/
In case you were interested the dynatable code I'm referring to is:
Best of luck!