DataGrid shows no records
Archived from the Xataface Users forum.
gsilvis — Sat Dec 26, 2009 6:51 pm
I’m trying out the DataGrid feature. Followed instructions and see the “Grid” tab. That page shows the a record count matching what was on the list tab. But there is no data displayed. I’m logged in as ADMIN.
What did I miss?
Thanks
George
gsilvis — Sun Dec 27, 2009 7:41 am
Some more detail on the no-records problem. The error-console shows:
“Not well-formed” and points to the “A” in “Bundle=A” in the first line below:
- Code: Select all
- `
HD88189 D image/jpeg
11B
A
1
1
</row>`
This might be related to my Cards\Cards.php entry of:
- Code: Select all
// combine Box/Bundle/PDF/Page in the selection lists function getTitle(&$record){ return $record->val('Box').' '.$record->val('Bundle').' '.$record->val('PDF').' '.$record->val('Page'); } function titleColumn(){ return "CONCAT(Box, ' ', Bundle, ' ', PDF, ' ', Page)"; }
Where Box and Bundle are text (VarChars and PDF and Page are TinyInts and together the 4 fields combine for the Primary Key. I’m thinking this is the problem, combining the chars and the ints.
- Is this right?
- Is there a work around?
- I have no problem with making PDF and Page varchars. Can that be done without destroying the records already in the database? That is, I would need 24 converted to “24”. I’ll try an experiment on a scratch db.
Thanks
George
gsilvis — Tue Dec 29, 2009 4:19 pm
I tried making all 4 fields of the primary key varchars; no joy. Same fault.
Maybe it just doesn’t like multi-field primary keys.
George
gsilvis — Wed Dec 30, 2009 7:30 am
I changed to a single-field primary key and data now displays in the grid. Problem now is that it never saves the entries. The only other anamolies is that it displays 2 integer fields (one which shows values of “false”) and it doesn’t display a varchar field.
Suggestions?
George
shannah — Wed Dec 30, 2009 10:49 am
Thanks for doing the research to narrow the first problem down to multi-field primary keys (although this should work).
Check out this thread and see if the solution woks for you.
viewtopic.php?f=4&t=5073&hilit=datagrid