Page 1 of 1

JQuery refresh data

Posted: Fri Aug 23, 2013 11:15 pm
by ccplusit

Anybody used JQuery or Ajax to refresh page data without reloading the whole page! I need a way of doing this as we have a lot of data and changes running in the background continually. Ideally a way of doing it from ether a time function or button click.

I see JQuery is in the file directory but not sure how to go about this.


Re: JQuery refresh data

Posted: Sat Aug 24, 2013 6:48 pm
by mobhar

Simply Google for "jquery refresh page without reload".


Re: JQuery refresh data

Posted: Sun Aug 25, 2013 12:48 am
by ccplusit

I have googled and come up with this but no success, in the list page Client Script I have added

src="ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js//Full URL to ajax js

and in the Startup Script added

$(document).ready(function() {

$("#gmp_getaccountcdrs").fadeOut("fast").load("ad_getsubaccountcdrslist.php").fadeIn("slow");

var refreshId = setInterval(function() {
$("#gmp_getaccountcdrs").fadeOut("fast").load("ad_getsubaccountcdrslist.php").fadeIn("slow");
}, 50000);

$.ajaxSetup({ cache: false });

});

I was expecting the <div id="gmp_getaccountcdrs" class="ewGridMiddlePanel"> division to get reloaded but nothing seems to happen.

Any pointers welcome please.


Re: JQuery refresh data

Posted: Mon Aug 26, 2013 4:11 pm
by ccplusit

Ok sorted out the above and realised that what this would do would be to reload the whole page in to the gmp_getaccountcdrs Div. Is it possible to reload the table data only without complete refresh or is the structure generated not compatible for this sort of request.


Re: JQuery refresh data

Posted: Wed Aug 28, 2013 10:10 am
by mobhar

ccplusit wrote:
Is it possible to reload the table data only without complete refresh
or is the structure generated not compatible for this sort of request.

You should generate a blank page without header and footer and write your own custom code in there in order to display the table data as you desired, afterwards, load that file inside your "gmp_getaccountcdrs" Div section.