tableRowCheckboxToggle 介绍
- It generically adds the toggle checkBox function to any table rows you specify based on the css class names.
- It will by default toggle any checkBoxes within the table row.
- You can manually exclude checkBoxes based on name, id or css classes in the script.
- If there is any applicable checkBoxes inside of the table row that are checked, it will apply a class to the table row.
- It also marks table rows when there are checked applicable checkBoxes on page load.
Simply include jQuery and this javascript and customize below in the
javascript:
// give me a list of table rows classes you want to apply this affect to var tableRowCheckBoxToggleClasses=new Array('odd_row', 'even_row'); // give me a class name you want to add to the table row when there are checkBoxes checked var tableRowCheckBoxCheckedClass='marked'; // by default, this script will apply to checkBoxes within the rows specified // HOWEVER, you may manually exclude certain checkBoxes based on their name, id or class // specify below var excludeCheckBoxesWithNames=new Array('testName'); var excludeCheckBoxesWithIds=new Array('checkme100', 'checkme101'); var excludeCheckBoxesWithClasses=new Array('testClass');
It will just work :)