Re: Best way to do AJAX (superfly)

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: Best way to do AJAX (superfly)

by standerby :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Thank you superfly. It is really helpful.

Lewis


----------------------------------------------------------------------

Message: 1
Date: Wed, 16 Jan 2008 06:58:46 -0800 (PST)
From: superfly
Subject: Re: [HTML_AJAX-devel] Best way to do AJAX
To: html_ajax-devel@...
Message-ID: <14881479.post@...>
Content-Type: text/plain; charset=us-ascii


hey lewis!

first see the examples how to setup the PEAR_AJAX server.php and to start
the class. when you got this, you should end up with a class you start via
the server.php. in this class you can put functions to interact with your
form. i show you an example how i made this for a project from myself...

in this func a user uses a radiobutton so re-sort the search results

class ajaxclass {

function ajaxclass(){
}

function updateorder($order, $pageID){

if(!empty($_SESSION['query'])){

require_once 'HTML/AJAX/Action.php';
$objAction =& new HTML_AJAX_Action();

if($order=='zuname'){
$_SESSION['query']['order'] = 'zuname';
}

if($order=='company'){
$_SESSION['query']['order'] = 'company';
}

if($order=='lastEdit'){
$_SESSION['query']['order'] = 'lastEdit';
}


if($_SESSION['query']['output']=='adressen'){
$output = utf8_encode(queryOutputAdresses($_SESSION['query'],$pageID));
}else{
$output = utf8_encode(queryOutputMarketing($_SESSION['query'],$pageID));
}

$objAction->assignAttr('result', 'innerHTML', $output); // 'result' is
the ID of an html element
return $objAction;
}

}


on the HTML side i call this func with:
onclick="ajaxclass.updateorder('company','$pageID');"

and the ajax output goes to

src="server.php?client=all&stub=ajaxclass">




sorry my english is not the best and this example might not be perfect
either, but maybe you get a glimpse how to use PEAR_AJAX

have fun,
superfly





standerby wrote:

>
> Hi,
>
> I am working on a web page, which has check box, radio button, slider,
> etc. What I want to accomplish is to display some data retrieved from
> database using the criteria enforced by those controls. I am using MDB2
> for database accessing and it works great. My question is what method I
> should use for HTML_AJAX to interactive with customer. For instance if a
> customer check a checkbox it will make a query to database and update the
> content div.
>
> Thanks,
> Lewis
>
>
> ---------------------------------
> Never miss a thing. Make Yahoo your homepage.
> _______________________________________________
> Html_ajax-devel mailing list
> Html_ajax-devel@...
> http://lists.bluga.net/mailman/listinfo/html_ajax-devel
>
>

--
View this message in context: http://www.nabble.com/Best-way-to-do-AJAX-tp14744756p14881479.html
Sent from the HTML_AJAX Dev/Support mailing list archive at Nabble.com.



------------------------------

_______________________________________________
Html_ajax-devel mailing list
Html_ajax-devel@...
http://lists.bluga.net/mailman/listinfo/html_ajax-devel


End of Html_ajax-devel Digest, Vol 29, Issue 2
**********************************************


Never miss a thing. Make Yahoo your homepage.
_______________________________________________
Html_ajax-devel mailing list
Html_ajax-devel@...
http://lists.bluga.net/mailman/listinfo/html_ajax-devel

Re: Best way to do AJAX (superfly)

by superfly :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

standerby wrote:
Thank you superfly. It is really helpful.

Lewis

and the ajax output goes to
src="server.php?client=all&stub=ajaxclass">
 var remote = new ajaxclass({});
some parts of my posts didnt get throu the nable security and i think i posted a bug :(


< h e a d e r >
< script type="java.... src="sever.php..." >
< script type="java.... >
var remote = new ajaxclass({}); // we need to start the class too

the js eventcall should then be -> onclick="remote.updateorder('company','<?=$pageID?>');"

now it should work ;)