Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
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 [url]http://www.montefili.it/dev/dg.php[/url], 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.phpCode: Select all
<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
Code: Select all
<HTML>
<?
require_once("dg.php");
?>
<?$dg->Render();?>(Ajax requests to dg.php)
</HTML>>>dg.php
Code: Select all
<?
require_once("DataGrid_class.php");
$dg=new DataGrid();
//$dg->Settings
$dg->Done();
?>
]b)Use sessions for settings:
>>User.php
Code: Select all
<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>I almost dislike both, do you have a better idea? or what do you think is the best?
Thank you for your help
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]