my second attempt at getting some help here...
i am trying to use a <cfset ajaxonload("showTtlrows")> at the bottom of
my page to call a js function which gets total number of records from a
cfgrid (see js code below; yes, the function in itself is correct and
works).
my cfgrid is bound to a cfc and works fine. the js function is correct
and works, too - if i call my js function from an onclick event of a
button, it works just fine and returns correct number of records from my
cfgrid.
the ajaxonload() call, however, does not work - it fires after the
cfgrid is drawn on the page but BEFORE it is populated with data: the
alert(totalrecords); pops up an alert over an empty cfgrid shell - only
the header and footer of the cfgrid are there, nothing else (no empty
rows, no data).
i am far from an ajax pro, and maybe i am misunderstanding thsomething,
but i was under the impression that ajaxonload() fires after all ajax UI
elements on the page have fully loaded.... am i wrong?
how can i make the ajaxonload() call run AFTER my cfgrid is populated
with data?
thanks for any help!
my js function:
showTtlrows = function(){
var mygrid = ColdFusion.Grid.getGridObject('resultsGrid');
var mygridData = mygrid.getDataSource();
var ttlrecords = mygridData.getTotalCount();
//var ttlrecords = mygridData.totalLength;
alert(ttlrecords);
//document.getElementById('ttlrows').innerHTML = ttlrecords;
}
--
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290127
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4