DoCheckAll
You can review the details about the doCheckAll JavaScript function.
Description
This JavaScript function toggles
the state of all the checkboxes in a table, using the following assumptions:
- The table must have separate head and body sections.
- Checkboxes within the body section must have the same column index as the specified checkbox object. Cells containing multiple checkboxes are all toggled.
Syntax
doCheckAll(obj)
Input parameters
obj - Optional. Handle to the checkbox object (in HTML object hierarchy) on a table header. If the object is not passed, the function just returns.
Return values
None.
Example
This example shows how an order list view showing order number and enterprise would handle the check all and uncheck all option in the table header row.
<table class="table" editable="false" width="100%" cellspacing="0">
<thead>
<tr>
<td sortable="no" class="checkboxheader">
<input type="checkbox" name="checkbox" value="checkbox"
onclick="doCheckAll(this);"/>
</td>
<td class="tablecolumnheader"><yfc:i18n>Order_#</yfc:i18n></td>
<td class="tablecolumnheader"><yfc:i18n>Enterprise</yfc:i18n></td>
</tr>
</thead>
<tbody>
<yfc:loopXML binding="xml:/OrderList/@Order" id="Order">
<tr>
<yfc:makeXMLInput name="orderKey">
<yfc:makeXMLKey binding="xml:/Order/@OrderHeaderKey"
value="xml:/Order/@OrderHeaderKey" />
</yfc:makeXMLInput>
<td class="checkboxcolumn">
<input type="checkbox" value='<%=getParameter("orderKey")%>'
name="EntityKey"/>
</td>
<td class="tablecolumn">
<a href="javascript:showDetailFor('<%=getParameter("orderKey")%>');">
<yfc:getXMLValue binding="xml:/Order/@OrderNo"/>
</a>
</td>
<td class="tablecolumn"><yfc:getXMLValue
binding="xml:/Order/@EnterpriseCode"/>
</td>
</tr>
</yfc:loopXML>
</tbody>
</table>