So why are you using:
$w.onReady(function(){
}
2 times? You only need to use it once.
Also, are you trying to create a new item?
$w('#dataset1').new();
I could only find that it is to create a new item in the documentation:
Or are you trying to achieve something else with it???
If you are not trying to do that, just remove it. That might be the bug.