Whenever I have used jal in jhs, I have been missing the old "select
all"/"select none" functionality.
So, today, I looked at a jal page, to see how I could add this to the page.
And, it looks to me as if I could add a function like:
function ChangeCheckboxes(fn) {
var inps= document.getElementsByTagName('input');
var iLen= inps.length
for (var j= 0; j<iLen; j++) {
var inp= inps[j];
if ('checkbox' === inp.type) inp.checked= fn(inp.checked)
}
}
to the JS=: at the bottom of addons/ide/jhs/jal.ijs
With this in place, I could use:
<input type="button" onclick="ChangeCheckboxes(function(t){return
!t;});" value="Toggle Selected" />
<input type="button" onclick="ChangeCheckboxes(function(){return
true;});" value="Select All" />
<input type="button" onclick="ChangeCheckboxes(function(){return
false;});" value="Select None" />
to get the functionality I wish I had.
But I am not sure how best to get them on the page.
The other buttons were written by jhb, but that does not seem like the
right choice for buttons that are not meant to raise a server event.
What would be a stylistically good way of integrating this kind of
change with jal?
Thanks,
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm