Login Retreive lost passwordRegister
Search

Forum Index / General / datagrid-feeling

[ This topic is solved ]

  WST2 03 March 06 / 12:50  
hello,
I'am looking for an example can display / edit records like a datagrid
thanks
WST

  Teye Heimans (Founder) 03 March 06 / 13:43  
Sorry, FormHandler does not have a datagrid component (yet)...

  WST2 04 March 06 / 00:49  
I had found an data-pager instead of grid named: adodb-pager
from http://sourceforge.net/project/showfiles.php?group_id=42718
The ressoure is easy to use and include in FH3.
In my opinion is this a helpful tool to show and handle datapages from databases (mysql, oracle, MS Access etc.), until you will create a datagrid ???
WST

  gene 04 March 06 / 03:02  
i found this http://www.kode.de/phpgrid/

coding was hard to follow for me but if you are a PHP expert then you will have better luck.


.

  WST2 18 March 06 / 19:22  
thanks to your help, gene .....

Now i have a datagrid editor, which based on the sample of
http://www.kode.de/phpgrid/

If you are interested to try this coding, contact me at
wilfried.steinhoff@gmx.de

WST

  WST2 21 March 06 / 18:15  
I enter data into pageable gridrows.
But also display a FormHandler's form to manage the entrys ( add / update / delete ).
This fh-Form is autogenerated from the table discription .....

  Teye Heimans (Founder) 22 March 06 / 21:32  
Could you send me your code how you use the grid editor in combination with formhandler? info@formhandler.net

  psy 12 April 06 / 15:44  
Hello

I have developed a datagrid that works with FH3 and need someone to quality control/test it for me. The grid follows the dispayed record, ie if the record is 3rd on the 4th page of the grid, then OK.

The whole package is a 'starting block', ie you start with a MYSQL db and then DIO builds the whole app. "DIO" stands for "Do It Once".

Please respond if you are willing to help develop this app.

Cheers
Prue

  gene 12 April 06 / 16:45  
i can test it for you

  psy 12 April 06 / 16:51  
Ooops I should add...

The datagrid shows AND SORTS on foreign key fields (unlike PEAR DB DBODO Structures Datagrid).

To initiate the app, all that you need to do is follow a few simple rules:

1. The first field in each table is an auto-increment field with a name of the table plus "_id", eg the first field in the table name "customer" is "customer_id". The next field in the "customer" dbase is "address_id" which is the primary key of the "address" table.

3. The DIO app automatically builds the relationships and in the grid shows the value of the foreign key fields. So when you sort on "Address" in the "Customer" table all is kosher.

Does that make sense? Anyhow, it works for me which after a 1000 or more lines of code Pear, DB, DBDO and Structures_Data_Grid didnt!

DIO still has a few minor bugs (mostly to do with js onclick events) so would appreciate any and all feedback.

Cheers
psy

  psy 12 April 06 / 16:58  
Thanks gene


Will package it up with a few destructions (oops) instructions, tomorrow.

Big smiles
psy

  psy 12 April 06 / 17:19  
Sorry Gene,
Also meant to add, that the DIO app searches and outputs to pdf and xls the entire dataset, not just the displayed dataset. Will need help if the user only wants to output a particular range of records.

  gene 12 April 06 / 19:43  
no problem. I'm pretty good at working things out.

I couldn't quite tell but does it require any other special PHP classes, etc?

  psy 15 April 06 / 06:06  
Yes. None of the FH3 files have been modified. I have sent you the zip file including instructions today.
psy

  Andy 18 April 06 / 11:11  
If you need another tester, let me know and I'll give it a try!

  psy 18 April 06 / 14:05  
Thanks Andy
I'm waiting for feedback from Teye and Gene first. If they think it's going OK I'll send you a copy for comments too.
Regards
psy

  gene 19 April 06 / 04:22  
Changed at 19 April 06 / 04:23
well, what looked like an easy week for me has turned busy. so I haven't had a chance to look at DIOgrid.

but I do have one question. the readme says

 Quote
 
The first prerequisite is that all MYSQL tables MUST have the first field as the primary key. The primary key MUST be the same as the tablename with the addition of "_id"


The one thing that strikes me is the requirement that "The primary key MUST be the same as the tablename with the addition of "_id." That is going to be difficult. While the first field may in fact be the primary key and auto increment, it most assuredly won't be named "table_name_id." link_id, category_id, record_id, etc. but not "table_name_id."

for me, if that is a requirement, then the DIUgrrid would not work.



.

  psy 19 April 06 / 06:23  
They have to be the same if you want to automatically generate the application. If your mysql table name is record, then the primary key needs to be record_id. The appbuilder has to have a way of associating the key with the table and differentiating between the primary and foreign keys.

If table name and PK are different, one thing to try is to manually write the linkdisplay and gridcolumn arrays (and the form pages). It may need some mods in other places too. This is totally untested.

  gene 19 April 06 / 13:41  
Changed at 19 April 06 / 13:41
is there a way to have that info as a variable and put that info in configuration file?

with that limiting factor, I would almost never be able to use DIOgrid with any third party databases (unless I just got lucky and the author happened to follow your naming convention).

I developed a database application using FormHandler extensively. I use it to add and edit records. I used what I called a data dictionary where I defined the fields. It looks like

<?php
dd_link_table 
"idx_link";
dd_link_link_id "link_id";
dd_link_category_id "category_id";
$dd_link_title "title";
$dd_link_url "url";
$dd_link_description "description";
?>


and

<?php
$dd_category_table 
"idx_category";
$dd_cat_category_id "category_id";
$dd_cat_parent_id "parent_id";
$dd_cat_name "name";
$dd_cat_description "description";
?>


then, i just used the corresponding $dd_var name as appropriate.

It can adapted to other tables by changing the data dictionary. For example:


<?php
dd_link_table 
"links";
dd_link_link_id "linkid";
dd_link_category_id "cat_id";
$dd_link_title "link_title";
$dd_link_url "link_url";
$dd_link_description "link_desc";
?>


and

<?php
$dd_category_table 
"category";
$dd_cat_category_id "cat_id";
$dd_cat_parent_id "parent_id";
$dd_cat_name "cat_name";
$dd_cat_description "cat_desc";
?>


But this is a manual process. and is used for specific types of databases.

your's is more automated and i guess could be used with almost any database.


.

  psy 19 April 06 / 14:46  
It's just software so anything is possible. I've put forward an idea. It works if you follow the guidelines. If your situation is different, then come forward with another solution to make DIO work.

  WST2 17 May 06 / 20:57  
Hello Teye,
i send you my sample coding some weeks ago and
still waiting for a feedback ....
waiting in Germany
WST

  Top


powered by PHP-GLOBE   © 2004 - 2008 FormHandler. All rights reserved.   -   Open source license