Login Register

Displaying Grid in the widget

I'm trying to put grid in widget and than display widget on various places but I have a problem. My widget dosn't show any thing neither post request to the application in the backend.

This is my code:

<div id="templateForWidget1" dojoType="dijit.Declaration"  widgetClass="test.TestGrid"
    <script type="text/javascript">   
      dojo.require("dojox.data.QueryReadStore");
      dojo.require("dojox.grid._data.model");
      dojo.require("dojox.grid.Grid");
         var rezervacijeView = {
          cells: [[
                                {name: 'Id', field: "id", width: "15px" },
                                {name: 'Od', field: "od", width: "150px" },
                                {name: 'Do', field: "do", width: "150px"},
                                {name: 'Produzena do', field: "produzi_do", width: "150px"},
                                {name: 'Zavrsena', field: "datum_zavrsetka", width: "150px"},
                                {name: 'Status', field: "status", width: "100px"},
                        ]]
        };

        var layout = [ rezervacijeView ]
    </script>
    <div dojoType="dojox.data.QueryReadStore" jsId="rezStore"  url="rezervacija/getRezervacije"  requestMethod="post"></div>
    <div dojoType="dojox.grid.data.DojoData" jsId="rezervacijeModel" rowsPerPage="20" store="rezStore" query="{ id: '*'}" > </div>
    <div dojoType="dojox.Grid" model="rezervacijeModel" structure="layout"></div>
</div>       

  <div  dojoType="test.TestGrid" ></div>

... so when I call widget with last div it doesn't show anything on the page neither post request to url defined in queryReadStore...

funny thing is that when I add dojo button in widget it displays page corectly ( grid and the button)

....
    </script>
    <button dojoType="dijit.form.Button" >test</button>
    <div dojoType="dojox.data......

How can I fix this to just display grid without button :).