Bug: Configures right ascending sorting in companies list.
* Configures right ascending icon in companies list when it is sorted by company name (default option). * Removes manual wrong sorting in controller and uses the provided by the Grid component.
This commit is contained in:
parent
e45fe5cf63
commit
5fd977ffcf
2 changed files with 5 additions and 17 deletions
|
|
@ -34,14 +34,15 @@ import org.libreplan.web.common.BaseCRUDController;
|
|||
import org.libreplan.web.common.Level;
|
||||
import org.libreplan.web.common.components.Autocomplete;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zul.Column;
|
||||
import org.zkoss.zul.Comboitem;
|
||||
import org.zkoss.zul.Textbox;
|
||||
|
||||
/**
|
||||
* Controller for CRUD actions over a {@link User}
|
||||
*
|
||||
* @author Jacobo Aragunde Perez <jaragunde@igalia.com>
|
||||
* @author Susana Montes Pedreira <smontes@wirelessgalicia.com>
|
||||
* @author Javier Moran Rua <jmoran@igalia.com>
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ExternalCompanyCRUDController extends
|
||||
|
|
@ -78,6 +79,7 @@ public class ExternalCompanyCRUDController extends
|
|||
goToEditForm(dto.getCompany());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void save() throws ValidationException {
|
||||
externalCompanyModel.confirmSave();
|
||||
}
|
||||
|
|
@ -134,19 +136,6 @@ public class ExternalCompanyCRUDController extends
|
|||
ourCompanyPassword.setConstraint("");
|
||||
}
|
||||
|
||||
public void sortByDefaultByName() {
|
||||
Column column = (Column) listWindow.getFellowIfAny("columnName");
|
||||
if (column != null) {
|
||||
if (column.getSortDirection().equals("ascending")) {
|
||||
column.sort(false, false);
|
||||
column.setSortDirection("ascending");
|
||||
} else if (column.getSortDirection().equals("descending")) {
|
||||
column.sort(true, false);
|
||||
column.setSortDirection("descending");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getEntityType() {
|
||||
return _("Company");
|
||||
|
|
|
|||
|
|
@ -21,10 +21,9 @@
|
|||
|
||||
<window id="${arg.top_id}" title="${i18n:_('Companies List')}">
|
||||
<newdatasortablegrid id="listing" model="@{controller.companiesDTO}" mold="paging"
|
||||
pageSize="10" sclass="clickable-rows"
|
||||
onInitRender="controller.sortByDefaultByName();">
|
||||
pageSize="10" sclass="clickable-rows">
|
||||
<columns sizable="true">
|
||||
<newdatasortablecolumn id="columnName" label="${i18n:_('Name')}" sort="auto(lower(name))" sortDirection="descending"/>
|
||||
<newdatasortablecolumn id="columnName" label="${i18n:_('Name')}" sort="auto(lower(name))" sortDirection="ascending"/>
|
||||
<newdatasortablecolumn label="${i18n:_('Company ID')}" />
|
||||
<newdatasortablecolumn label="${i18n:_('Client')}" />
|
||||
<newdatasortablecolumn label="${i18n:_('Subcontractor')}" />
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue