This is more of a hack but does work. You need to move the toolbar div after the datagrid div once the datagrid has been generated. This can be done in the onLoadSuccess event. ie
$('#dg').datagrid({
onLoadSuccess: function(){
$("#toolbar").insertAfter("#myid .datagrid-view");
}
});
...
<div id="myid">
<table id="dg" toolbar="#toolbar" ></table>
<div id="toolbar"></div>
</div>