[OFBiz] Dev - multi forms (widget) and select all javascript
Posted by
Jacopo Cappellato on
URL: http://ofbiz.116.s1.nabble.com/OFBiz-Dev-multi-forms-widget-and-select-all-javascript-tp166101.html
Hi all,
I'm trying to add a selectAll checkbox to select/deselect all the rows
of a multi form rendered thru the widget.
Unfortunately the javascript functions defined in the selectall.js file
use a hardcoded form name ("selectAllForm").
To make them more flexible I've created a new toggleAll() function that
accepts the form name as a parameter:
function toggleAll(e, formName) {
var cform = document[formName];
var len = cform.elements.length;
for (var i = 0; i < len; i++) {
var element = cform.elements[i];
if (element.name.substring(0, 10) == "_rowSubmit" &&
element.checked != e.checked) {
toggle(element);
}
}
}
Could someone commit this change? If you think that it is good I can
refactor also the other functions in the same file to accept the form name.
I'm sorry, this is not a diff patch because the file is marked as binary.
Jacopo
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev