Dynamic grid layout structure

Hi all!

How can I create dynamic grid layout structure based on structure defined in database table?

for example:
1.) have a table A. In it are only table names of tables for which I want to make grids
2.) I want to take "show columns for chosen table" the column names and column data types and upon them dinamically create layout cell structure.

Bellow is example of hard coded layout structure from dojo grid test example. What I want is to dynamically fill the cell array of columns structure from db table;

var gridLayout = [
{ type: "dojox.GridRowView", width: "20px" },
{ defaultCell: { width: 6, editor: dojox.grid.editors.Dijit },
cells: [[

{ name: 'Id', styles: 'text-align: right;', editorClass: "dijit.form.NumberTextBox" },
{ name: 'Name', width: 20},
{ name: 'Message', styles: 'text-align: right;'},
{ name: 'Date',
editor: mySqlDateEditor,
formatter: formatMySqlDate,
constraint: {selector: "date"},
width: 10,
styles: 'text-align:right;'}

]]
}
];

Thank you in Advance,
David

Back to top