dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16040
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5976: (patient) Don't paging by ajax.
------------------------------------------------------------
revno: 5976
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-02-16 10:58:17 +0700
message:
(patient) Don't paging by ajax.
modified:
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js 2012-02-15 13:19:34 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js 2012-02-16 03:58:17 +0000
@@ -1519,12 +1519,35 @@
// Paging
// -----------------------------------------------------------------------------
+
+isAjax = false;
function pagingList( currentPage, pageSize )
{
var baseLink = jQuery( "#baseLink" ).val();
var url = baseLink + "currentPage=" + currentPage + "&pageSize=" + pageSize;
- window.location.href = url;
+ if ( isAjax == false )
+ {
+ window.location.href = url;
+ }
+ else
+ {
+ var index = url.indexOf( '?' );
+ var link = url.substring( 0, index );
+ var data = url.substring( index + 1 );
+
+ jQuery.postUTF8( link , data, function(html)
+ {
+ if ( contentDiv == undefined )
+ {
+ setInnerHTML( 'contentDiv', html );
+ }
+ else
+ {
+ setInnerHTML( contentDiv, html );
+ }
+ } );
+ }
}
function changePageSize( event )