Hi,
I'm currently developing a Datagrid class to easly show, sort, filter, page and edit data rows.
You can take a look to an old verison on www.montefili.it/dev/dg.php, it works only on ie..
As soon as i finish i want to post it on phpclasses.org.
Now so far the class is almost complete, but I was wondering to move it on ajax, but my skills are zero, so i have some doubts about it but my main question is on the page structure.
Actually its something like that:
User.php
<HTML>
<?
require_once("DataGrid_class.php");
$dg=new DataGrid();
//$dg->Settings
?>
<?$dg->Render();?>
</HTML>
But in ajax i need a page that know all the settings but doesnt have the user grafical interface, so can reply to requests without rendering each time the unwanted html.
I can found only two ways of doing that:
a)Use a kind of configuration file (here dg.php) that replies to ajax requests, something like:
User.php
<HTML>
<?
require_once("dg.php");
?>
<?$dg->Render();?>(Ajax requests to dg.php)
</HTML>
dg.php
<?
require_once("DataGrid_class.php");
$dg=new DataGrid();
//$dg->Settings
$dg->Done();
?>
]
b)Use sessions for settings:
<HTML>
<?
require_once("DataGrid_class.php");
$dg=new DataGrid();
//$dg->Settings
?>
<?$dg->Render();?>(Ajax requests directly to Datagrid_class.php?datagrid_name, settings stored in session [$datagrid_name])
</HTML>
Using session have a major drawback: i cant easly use callback funtion and user defined procedure..
I almost dislike both, do you have a better idea? or what do you think is the best?
Thank you for your help