Author: apatel
Date: Wed Jul 29 12:56:33 2009 New Revision: 798880 URL: http://svn.apache.org/viewvc?rev=798880&view=rev Log: Fixing bahavior of select all checkbox for orderlist. User call select all items using selectall checkbox and then remove few items from selected list. Modified: ofbiz/trunk/applications/order/webapp/ordermgr/order/findOrders.ftl Modified: ofbiz/trunk/applications/order/webapp/ordermgr/order/findOrders.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/findOrders.ftl?rev=798880&r1=798879&r2=798880&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/order/findOrders.ftl (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/order/findOrders.ftl Wed Jul 29 12:56:33 2009 @@ -40,7 +40,6 @@ var element = form.elements[i]; if (element.name == "orderIdList") { element.checked = master.checked; - element.disabled = !element.disabled; } } } @@ -49,15 +48,21 @@ } function runAction() { var form = document.massOrderChangeForm; + form.submit(); +} + +function toggleOrderIdList() { + var form = document.massOrderChangeForm; var orders = form.elements.length; + var isAllSelected = true; for (var i = 0; i < orders; i++) { var element = form.elements[i]; - if (element.name == "orderIdList") { - element.disabled = false; - } + if (element.name == "orderIdList" && !element.checked) + isAllSelected = false; } - form.submit(); + $('checkAllOrders').checked = isAllSelected; } + // --> function paginateOrderList(viewSize, viewIndex, hideFields) { @@ -521,7 +526,6 @@ <form name="massOrderChangeForm" method="post" action="javascript:void();"> <div> </div> <div align="right"> - <input type="hidden" name="orderIdList" value=""/> <input type="hidden" name="screenLocation" value="component://order/widget/ordermgr/OrderPrintScreens.xml#OrderPDF"/> <select name="serviceName" onchange="javascript:setServiceName(this);"> <option value="javascript:void();"> </option> @@ -548,7 +552,7 @@ <table class="basic-table hover-bar" cellspacing='0'> <tr class="header-row"> <td width="1%"> - <input type="checkbox" name="checkAllOrders" value="1" onchange="javascript:toggleOrderId(this);"/> + <input type="checkbox" id="checkAllOrders" name="checkAllOrders" value="1" onchange="javascript:toggleOrderId(this);"/> </td> <td width="5%">${uiLabelMap.OrderOrderType}</td> <td width="5%">${uiLabelMap.OrderOrderId}</td> @@ -584,7 +588,7 @@ <#assign partyId = displayParty.partyId?default("_NA_")> <tr valign="middle"<#if alt_row> class="alternate-row"</#if>> <td> - <input type="checkbox" name="orderIdList" value="${orderHeader.orderId}"/> + <input type="checkbox" name="orderIdList" value="${orderHeader.orderId}" onchange="javascript:toggleOrderIdList();"/> </td> <td>${orderType.get("description",locale)?default(orderType.orderTypeId?default(""))}</td> <td><a href="<@ofbizUrl>orderview?orderId=${orderHeader.orderId}</@ofbizUrl>" class='buttontext'>${orderHeader.orderId}</a></td> @@ -677,4 +681,4 @@ </div> <#else> <h3>${uiLabelMap.OrderViewPermissionError}</h3> -</#if> \ No newline at end of file +</#if> |
Free forum by Nabble | Edit this page |