0

I want to implement a very simple Dojo DataGrid in a declarative way. I have this

<script>
require(['dojox/grid/DataGrid', 'dojo/data/ItemFileReadStore', 'dojo/query'],
  function(DataGrid, ItemFileReadStore){


    var layout = [
        {name: 'Index', field: 'id', 'width': '100px'},
        {name: 'Date', field: 'date', 'width': '300px'},
        {name: 'Name', field: 'name', 'width': '600px'}
    ];

    var myStore = new ItemFileReadStore({
        data: {
            identifier: "id",
            items: [
                {id: 1, date: '2010-01-01', name: 'dadasd dsadasdas dasdasdasd asdasdadas asd dasdasdas'},
                {id: 2, date: '2011-03-04', name: 'dadasd dsadasdas dasdasdasd asdasdadas asd dasdasdas'},
                {id: 3, date: '2011-03-08', name: 'dadasd dsadasdas dasdasdasd asdasdadas asd dasdasdas'},
                {id: 4, date: '2007-02-14', name: 'dadasd dsadasdas dasdasdasd asdasdadas asd dasdasdas'}
            ]
        }
    });

});
    </script>
</head>
<body class="claro">
    <div style="width:1024px;margin:auto">       
        <table id="myGrid" data-dojo-typ="dojox.grid.DataGrid" data-dojo-props="store:myStore,  query:{ id: '*' },  clientSort:true, rowSelector:'20px'">
            <thead>
                <tr>
                    <th field="id" width="50px">Id</th>
                    <th field="date" width="100px">Date</th>
                    <th field="name" width="400px">Name</th>
                </tr>        
            </thead>
        </table>    
    </div>
</body>

But nothing is displayed (only the table header columns ... and i do not have js errors in console) Can someone help me with this? Thanks

tinti
  • 1,455
  • 8
  • 23
  • 39
  • You have a typo in the table where it says `data-dojo-typ`. Also you've got a mixed syntax for dojo modules, if you are using version 1.7 or above, all dojo types should have `/` not `.` (e.g. `data-dojo-type="dojox/grid/DataGrid"`). Also I'm assuming you've got a dojo config somewhere and a dojo script import? – Jeremy Oct 23 '13 at 21:32
  • Hi! Yes the typo was only here ... on my app is correct. Also the imports are ok. Anyway ... in the mean time i send to dojo developers this issue. The answer was that from 1.9.x DataGrid is deprecated. – tinti Oct 25 '13 at 13:00

0 Answers0