[Dojo-interest] [Q] How can I use Declarative widget, but constuctor arg -- programmatically

V S P toreason at fastmail.fm
Fri Aug 29 08:15:59 UTC 2008


I am trying to 'concuct'
an approach where

I want to declare a dojox.DataGrid declartively
but whant to specify the 'query' and 'structure'
arguments programmatically (because I cannot figure
out how to specify them declaratively,when there lots of options);

So I am using <script="dojo/method">  to 
'initialize' things -- because apparently it is being invoked
after the widget is constructed but 'before' it is being rendered.

But that for some reason is not working (or may be it is not supposed to
work)
So need some help.
------------------------------------------------

<table style="font-size:auto;" id="grid" 
dojoType="dojox.grid.DataGrid" jsId="grid" rowSelector="20px" 
>
<script type="dojo/method">                     
			gridLayout = {
				defaultCell: { width: 8, editable: true, styles: 'text-align: right;'  },
				cells: [
					{ name: 'Id', width: 3, field: 'id' },
					{ name: 'Priority', field: 'col1', styles: 'text-align: center;', type: dojox.grid.cells.Select, options: ["normal", "note", "important"]},
					{ name: 'Mark', field: 'col2', width: 3, styles: 'text-align: center;', type: dojox.grid.cells.Bool },
					{ name: 'Status', field: 'col3', styles: 'text-align: center;', type: dojox.grid.cells.Select, options: [ "new", "read", "replied" ]},
					{ name: 'Message', field: 'col4', styles: '', width: '100%' },
					{ name: 'Amount', field: 'col5'}
				]
			};
		this.structure=gridLayout;
                //will setup store later
		//this.setStore(test_store);
		this.startup();
		
		
</script>
</table>


-- 
  V S P
  toreason at fastmail.fm

-- 
http://www.fastmail.fm - IMAP accessible web-mail



More information about the Dojo-interest mailing list