Page 1 of 1

DataGrid shows no records

PostPosted: Sat Dec 26, 2009 6:51 pm
by gsilvis
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

Re: DataGrid shows no records

PostPosted: Sun Dec 27, 2009 7:41 am
by gsilvis
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
<datastore>
   <row id="Cards?Box=11B&Bundle=A&PDF=1&Page=1">
                        <CardImage></CardImage>
                     <Star>HD88189</Star>
                     <StdStar></StdStar>
                     <Class>D</Class>
                     <Notes></Notes>
                     <CardImage_mimetype>image/jpeg</CardImage_mimetype>

                     <other></other>
                     <Box>11B</Box>
                     <Bundle>A</Bundle>
                     <PDF>1</PDF>
                     <Page>1</Page>
            </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

Re: DataGrid shows no records

PostPosted: Tue Dec 29, 2009 4:19 pm
by gsilvis
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

Re: DataGrid shows no records

PostPosted: Wed Dec 30, 2009 7:30 am
by gsilvis
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

Re: DataGrid shows no records

PostPosted: Wed Dec 30, 2009 10:49 am
by shannah
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