jfreeman2010
asked on
cfgrid column record counts.
cfgrid column records count:
I have the following CFGRID with a bind attribute:
<cfform method="get" format="HTML" id="Testlist" name="Testlist" >
<cfgrid name="Testlist" striperows="yes" format="html" selectmode="row" sort="yes"
selectonload="false" pagesize="26" height="690" colheaderbold="yes"
bind="cfc:cfc.Testlist.get _Testlist( {cfgridpag e},{cfgrid pagesize}, {cfgridsor tcolumn},{ cfgridsort direction} ,{testid}) "
onfocus="" >
<cfgridcolumn name="TEST_CODE" width="120" header="TEST Code" headeralign="left" display="no" >
<cfgridcolumn name="FIRST_NAME" width="160" header="First Name" headeralign="left">
<cfgridcolumn name="LAST_NAME" width="160" header="Last Name" headeralign="left">
<cfgridcolumn name="TEST_1" width="120" header="Test 1" headeralign="left">
<cfgridcolumn name="TEST_2" width="100" header="Test 2" headeralign="left">
</cfgrid>
</cfform>
The CFC call a stored produce to return the result query.
I had the cfgrid display find.
How do I get total result query count, total TEST_1 count and TEST_2 count, and display them on top of the grid?
I have the following CFGRID with a bind attribute:
<cfform method="get" format="HTML" id="Testlist" name="Testlist" >
<cfgrid name="Testlist" striperows="yes" format="html" selectmode="row" sort="yes"
selectonload="false" pagesize="26" height="690" colheaderbold="yes"
bind="cfc:cfc.Testlist.get
onfocus="" >
<cfgridcolumn name="TEST_CODE" width="120" header="TEST Code" headeralign="left" display="no" >
<cfgridcolumn name="FIRST_NAME" width="160" header="First Name" headeralign="left">
<cfgridcolumn name="LAST_NAME" width="160" header="Last Name" headeralign="left">
<cfgridcolumn name="TEST_1" width="120" header="Test 1" headeralign="left">
<cfgridcolumn name="TEST_2" width="100" header="Test 2" headeralign="left">
</cfgrid>
</cfform>
The CFC call a stored produce to return the result query.
I had the cfgrid display find.
How do I get total result query count, total TEST_1 count and TEST_2 count, and display them on top of the grid?
ASKER
Thank you very much for the example. Its works great!!. I only have a little issue here: I need a count on TEST_1 and TEST_2. In the live data I return Y/N on those two columns. If is 'Y', it count as 1, if is 'N' it did not count. so in the test.cfc, line 83,84, how can I change the arraysum to count base on the Y/N condition?
Thank you!!
Thank you!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
that will work. thank you very much.
attached is a working example (main .cfm page and test.cfc).
read comments in code!
Azadi
Open in new window