Search in sources :

Example 1 with TableCellClickListener

use of com.haulmont.cuba.web.toolkit.ui.client.tableshared.TableCellClickListener in project cuba by cuba-platform.

the class CubaScrollTableConnector method init.

@Override
protected void init() {
    super.init();
    getWidget()._delegate.cellClickListener = new TableCellClickListener() {

        @Override
        public void onClick(String columnKey, int rowKey) {
            getRpcProxy(CubaTableServerRpc.class).onClick(columnKey, String.valueOf(rowKey));
        }
    };
    tooltipHandlerRegistration = Event.addNativePreviewHandler(new Event.NativePreviewHandler() {

        @Override
        public void onPreviewNativeEvent(Event.NativePreviewEvent event) {
            if (event.getTypeInt() != Event.ONMOUSEMOVE || !Element.is(event.getNativeEvent().getEventTarget())) {
                return;
            }
            Element element = Element.as(event.getNativeEvent().getEventTarget());
            if ("div".equalsIgnoreCase(element.getTagName())) {
                String className = element.getClassName();
                if (className != null && (className.contains("v-table-caption-container") || className.contains("v-table-footer-container"))) {
                    DomEvent.fireNativeEvent(event.getNativeEvent(), getWidget());
                }
            }
        }
    });
}
Also used : TableCellClickListener(com.haulmont.cuba.web.toolkit.ui.client.tableshared.TableCellClickListener) Element(com.google.gwt.dom.client.Element)

Example 2 with TableCellClickListener

use of com.haulmont.cuba.web.toolkit.ui.client.tableshared.TableCellClickListener in project cuba by cuba-platform.

the class CubaTreeTableConnector method init.

@Override
protected void init() {
    super.init();
    getWidget()._delegate.cellClickListener = new TableCellClickListener() {

        @Override
        public void onClick(String columnKey, int rowKey) {
            getRpcProxy(CubaTableServerRpc.class).onClick(columnKey, String.valueOf(rowKey));
        }
    };
    tooltipHandlerRegistration = Event.addNativePreviewHandler(new Event.NativePreviewHandler() {

        @Override
        public void onPreviewNativeEvent(Event.NativePreviewEvent event) {
            if (event.getTypeInt() != Event.ONMOUSEMOVE || !Element.is(event.getNativeEvent().getEventTarget())) {
                return;
            }
            Element element = Element.as(event.getNativeEvent().getEventTarget());
            if ("div".equalsIgnoreCase(element.getTagName())) {
                String className = element.getClassName();
                if (className != null && (className.contains("v-table-caption-container") || className.contains("v-table-footer-container"))) {
                    DomEvent.fireNativeEvent(event.getNativeEvent(), getWidget());
                }
            }
        }
    });
}
Also used : TableCellClickListener(com.haulmont.cuba.web.toolkit.ui.client.tableshared.TableCellClickListener) Element(com.google.gwt.dom.client.Element)

Aggregations

Element (com.google.gwt.dom.client.Element)2 TableCellClickListener (com.haulmont.cuba.web.toolkit.ui.client.tableshared.TableCellClickListener)2