-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselect_all.js
More file actions
24 lines (19 loc) · 772 Bytes
/
select_all.js
File metadata and controls
24 lines (19 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function select_all(sel, fld)
{
var chk_all = document.getElementsByName(fld);
for(var i=0; i<chk_all.length; i++)
{
if(chk_all[i].style.display!='none')
chk_all[i].checked=sel;
}
}//end func...
$(document).ready(function(){
$('.datagrid td input[name=RecordID\\[\\]]').prop('checked', false); // prevent auto complete of checkboxes forcibly
$('.select_all').click(function(event){
select_all($(this).prop('checked'), del_fieldx);
});
});
//#- [USAGE]
//#/1) del_fieldx must be set before this script is called
//#/2) `.select_all` field must be a checkbox (like in gmail)
//#/2) <script>var del_fieldx='del_notif[]';</script><script type="text/javascript" src="assets/js/select_all.js"></script>