Thursday, 15 March 2012

spring mvc - Dojo grid: load data from html markup -


I am currently using dojox.grid.DataGrid to display data, In which the second request is sent to the server for the data I am using Spring MVC, and therefore I can fill the view (markup) using the model data (to be accurate, to use JSTL). And I'm not doing it where I'm coming closer to achieving it, because I can not find any way to get the data inside the grid through the HTML markup. Does the dojo grid help fill the data only through the script (store)?

I found dojox.data.HtmlStore that can be used but only to ensure that there is no better solution.

Yes, define dojox.grid.DataGrid using HTML markup can be done.

Sample code:

  & lt; Table data- dojo-type = "dojox.grid.DataGrid" & gt; & Lt; Thead & gt; & Lt; TR & gt; & Lt; Th field = "field name" & gt; Call 1 & lt; / Th & gt; & Lt; Th field = "field name" & gt; Call 2 & lt; / Th & gt; & Lt; / TR & gt; & Lt; / Thead & gt; & Lt; / Table & gt;  

Then there is logic to generate the above structure in your jsp .

More information can be found

For more data part, you can:

  & lt; Table data- dojo-type = "dojox.grid.DataGrid" & gt; & Lt; Thead & gt; & Lt; TR & gt; & Lt; Th field = "field name" get = "myData.getCol1" & gt; Call 1 & lt; / Th & gt; & Lt; Th field = "fieldName" get = "myData.getCol2" & gt; Call 2 & lt; / Th & gt; & Lt; / TR & gt; & Lt; / Thead & gt; & Lt; / Table & gt;  

Javascript function:

  myData.getCol1 = function (brandex, item) {return "keep original content here with your JSTL variable;" ; }; While  

The solution above works in a clever way, please use the store and return a built Jason object to the server.


No comments:

Post a Comment