I am trying to get the grid view to display data from a table in Postgres.
I have modified the test_mysql_edit sample to query Postgres (and my particular table).
My support/pg_data.php file is a copy of the support/data.php modified to query postgres, and my particular table (this included replacements for things like "SHOW TABLES" with the postgres equvalent query).
Now, I am getting data from the table (firebug shows the JSON code outputted). The rowcount correctly displays the number of rows. My grid just shows empty lines though (refreshes the lines from containing "..." to just blank, small rows). What am I doing wrong?
var model = new dojox.grid.data.DbTable(null, null, 'support/pg_data.php', "rag", "volume_task");
// simple display of row info; based on model observing.
modelChange = function() {
dojo.byId('rowCount').innerHTML = model.count + ' row(s)';
}
model.observer(this);
var gridLayout = [
{ type: "dojox.GridRowView", width: "20px" },
{
cells: [[
{ name: 'project_id'},
{ name: 'document_number', width: 20},
{ name: 'volume_task', styles: 'text-align: right;'},
{ name: 'sub_description'}
]]}
];
// simple display of row info; based on model observing.
modelChange = function() {
dojo.byId('rowCount').innerHTML = model.count + ' row(s)';
}
model.observer(this);
var gridLayout = [
{ type: "dojox.GridRowView", width: "20px" },
{
cells: [[
{ name: 'project_id'},
{ name: 'document_number', width: 20},
{ name: 'volume_task', styles: 'text-align: right;'},
{ name: 'sub_description'}
]]}
];
<button onclick="addRow()">Add Row</button>
<button onclick="removeSelected()">Remove Selected</button>
<button onclick="grid.edit.apply()">Apply Edit</button>
<button onclick="grid.edit.cancel()">Cancel Edit</button>
<button onclick="grid.refresh()">Refresh</button>
<br><br>
<div jsId="grid" class="grid" structure="gridLayout" dojoType="dojox.Grid" model="model" singleClickEdit="true" autoWidth="true"></div>
<div id="rowCount"></div>
<button onclick="removeSelected()">Remove Selected</button>
<button onclick="grid.edit.apply()">Apply Edit</button>
<button onclick="grid.edit.cancel()">Cancel Edit</button>
<button onclick="grid.refresh()">Refresh</button>
<br><br>
<div jsId="grid" class="grid" structure="gridLayout" dojoType="dojox.Grid" model="model" singleClickEdit="true" autoWidth="true"></div>
<div id="rowCount"></div>

Dumb question on my part:
Dumb question on my part: Do you have tundra.css and tundraGrid.css imported in style? Do you have class="tundra" in body? (Ok, two questions....)
Yes, to both questions.
Yes, to both questions.