spring mvc - Dojo grid: load data from html markup -
i'm using dojox.grid.datagrid
displaying data, in second request sent server data. i'm using spring mvc, , hence fill data (from markup) using model data in view (using jstl, exact). , i'm no getting near in achieving this, since cant find way data inside grid via html markup. dojo grid supports filling data via script (store)?
i found dojox.data.htmlstore
made use of. making sure there's no better solution.
yes, dojox.grid.datagrid
can defined using html markup.
sample code:
<table data-dojo-type="dojox.grid.datagrid" > <thead> <tr> <th field="fieldname" >col1</th> <th field="fieldname" >col2</th> </tr> </thead> </table>
so in jsp
have logic generate above structure.
more info can found here
and data part can this:
<table data-dojo-type="dojox.grid.datagrid" > <thead> <tr> <th field="fieldname" get="mydata.getcol1">col1</th> <th field="fieldname" get="mydata.getcol2">col2</th> </tr> </thead> </table>
javascript function:
mydata.getcol1 = function(colindex,item){ return "<place actual content jstl variables here>"; }; while
the above solution works not smarter way, please use store , return constructed json object server.
Comments
Post a Comment