You can review the information on the doCheckFirstLevel JavaScript function.

Description

This JavaScript function is used on the onclick event of a checkbox in the table column header. The function checks or unchecks all checkboxes in the first level of checkboxes in the table. This function is very similar to the doCheckAll JavaScript function, except that doCheckAll checks or unchecks all checkboxes within the specified HTML table.

Use this function for HTML tables that require this “(un)check all” functionality and also have one or more unrelated checkboxes inside the table that should not be affected by the selection checkboxes.

Syntax

doCheckFirstLevel(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 does nothing.

Output parameters

None.

Example

This example shows the table header definition for a list of items containing a checkbox where the user can select one or more items in the table. The header row of the table contains a checkbox. When this checkbox is selected, all of the first level check boxes within the HTML table are checked or unchecked.

<table class="table" cellspacing="0" width="100%">
   <thead>
     <tr>
       <td class="checkboxheader" sortable="no" style="width:10px">
         <input type="checkbox" value="checkbox" name="checkbox" 
onclick="doCheckFirstLevel(this);"/>
        </td>
         <td class="tablecolumnheader" 
style="width:30px"><yfc:i18n>Options</yfc:i18n></td>
         <td class="tablecolumnheader" 
style="width:<%=getUITableSize("xml:AdditionalServiceItem:/OrderLine/
AdditionalServiceItems/Item/@ItemID")%>"><yfc:i18n>Item_ID</yfc:i18n></td>
         <td class="tablecolumnheader" 
style="width:<%=getUITableSize("xml:AdditionalServiceItem:/OrderLine/
AdditionalServiceItems/Item/@UnitOfMeasure")%>"><yfc:i18n>UOM</yfc:i18n></td>
         <td class="tablecolumnheader" 
style="width:<%=getUITableSize("xml:AdditionalServiceItem:/OrderLine/
AdditionalServiceItems/Item/PrimaryInformation/@Description")%>">
<yfc:i18n>Item_Description</yfc:i18n></td>
         <td class="tablecolumnheader" 
style="width:<%=getUITableSize("xml:AdditionalServiceItem:/OrderLine/
AdditionalServiceItems/Item/@Price")%>"><yfc:i18n>Price</yfc:i18n></td>
     </tr>
   </thead>

Join The Discussion

Your email address will not be published. Required fields are marked *