[pLog-svn] r5781 - plog/trunk/js/ui
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Fri Aug 3 18:04:32 EDT 2007
Author: oscar
Date: 2007-08-03 18:04:32 -0400 (Fri, 03 Aug 2007)
New Revision: 5781
Modified:
plog/trunk/js/ui/ui.js
Log:
Added a very simple DataTable class whose markup is loaded via XmlHttpRequest and then set to wherver it belongs via innerHTML.
Modified: plog/trunk/js/ui/ui.js
===================================================================
--- plog/trunk/js/ui/ui.js 2007-08-03 22:02:58 UTC (rev 5780)
+++ plog/trunk/js/ui/ui.js 2007-08-03 22:04:32 UTC (rev 5781)
@@ -93,6 +93,40 @@
Lifetype.UI.AjaxPager.Events.dataLoaded.subscribe( function() { Lifetype.UI.ContentOverlay.processAnchors() } );
/**
+ * Implements a table that is able to change its data dynamically. This should only be used
+ * when the table doesn't display paginated data, please use Lifetype.UI.AjaxPager in all
+ * other cases.
+ */
+Lifetype.UI.DataTable = function() {}
+
+/**
+ * Events for the DataTable
+ */
+Lifetype.UI.DataTable.Events = function() {}
+Lifetype.UI.DataTable.Events.dataLoaded = new YAHOO.util.CustomEvent( 'tableDataLoaded' );
+
+/**
+ * Triggers a refresh of the table
+ * @param url
+ * @static
+ */
+Lifetype.UI.DataTable.reload = function( url )
+{
+ url = url.replace(/&/g, "&") + "&output=tableOnly";
+
+ var cObj = YAHOO.util.Connect.asyncRequest('GET', url,
+ callback = {
+ success: function( o ) {
+ Lifetype.Dom.$( 'list' ).innerHTML = o.responseText;
+
+ // fire the 'dataLoaded' in case somebody else wants to do so some post-processing of the data
+ Lifetype.UI.DataTable.Events.dataLoaded.fire( Lifetype.Dom.$( 'list' ));
+ }
+ }
+ );
+}
+
+/**
* Namespace for helper methods
*/
Lifetype.Helpers = function() {}
More information about the pLog-svn
mailing list