use of org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn in project scout.rt by eclipse.
the class JsonTable method fireSortFromUi.
protected void fireSortFromUi(JSONObject data) {
IColumn column = extractColumn(data);
boolean sortingRemoved = data.optBoolean("sortingRemoved");
// TODO [7.0] cgu: add filter for HEADER_UPDATE event with json data of column (execDecorateHeaderCell is called which may change other header properties (text etc)
if (sortingRemoved) {
getModel().getUIFacade().fireSortColumnRemovedFromUI(column);
} else {
boolean multiSort = data.optBoolean("multiSort");
boolean sortAscending = data.getBoolean("sortAscending");
getModel().getUIFacade().fireHeaderSortFromUI(column, multiSort, sortAscending);
}
}
use of org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn in project scout.rt by eclipse.
the class JsonTable method handleModelColumnHeadersUpdated.
protected void handleModelColumnHeadersUpdated(Collection<IColumn<?>> columns) {
JSONObject jsonEvent = new JSONObject();
Collection<IColumn<?>> visibleColumns = filterVisibleColumns(columns);
// Ignore columns that are not currently attached. They will be later
// attached with the event COLUMN_STRUCTURE_CHANGED.
List<IColumn<?>> filteredColumns = filterAttachedColumns(visibleColumns);
if (filteredColumns.isEmpty()) {
return;
}
putProperty(jsonEvent, PROP_COLUMNS, columnsToJson(filteredColumns));
addActionEvent(EVENT_COLUMN_HEADERS_UPDATED, jsonEvent);
}
use of org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn in project scout.rt by eclipse.
the class JsonTable method handleModelColumnOrderChanged.
protected void handleModelColumnOrderChanged() {
// Ignore columns that are not currently attached. They will be later
// attached with the event COLUMN_STRUCTURE_CHANGED.
List<IColumn<?>> filteredColumns = filterAttachedColumns(getColumnsInViewOrder());
if (filteredColumns.isEmpty()) {
return;
}
JSONObject jsonEvent = new JSONObject();
putProperty(jsonEvent, PROP_COLUMN_IDS, columnIdsToJson(filteredColumns));
addActionEvent(EVENT_COLUMN_ORDER_CHANGED, jsonEvent);
}
use of org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn in project scout.rt by eclipse.
the class JsonTable method createFilterState.
protected IUserFilterState createFilterState(JSONObject data) {
String filterType = data.getString("filterType");
if ("column".equals(filterType)) {
IColumn column = extractColumn(data);
JsonColumn jsonColumn = m_jsonColumns.get(column);
return jsonColumn.createFilterStateFromJson(data);
} else if ("text".equals(filterType)) {
String text = data.getString("text");
return new TableTextUserFilterState(text);
}
return null;
}
use of org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn in project scout.rt by eclipse.
the class JsonTable method handleUiAppLinkAction.
protected void handleUiAppLinkAction(JsonEvent event) {
IColumn column = extractColumn(event.getData());
String ref = event.getData().getString("ref");
if (column != null) {
getModel().getUIFacade().setContextColumnFromUI(column);
}
getModel().getUIFacade().fireAppLinkActionFromUI(ref);
}
Aggregations