Example usage for com.google.gwt.query.client GQuery $

List of usage examples for com.google.gwt.query.client GQuery $

Introduction

In this page you can find the example usage for com.google.gwt.query.client GQuery $.

Prototype

public static GQuery $(String selectorOrHtml, Widget context) 

Source Link

Document

This function accepts a string containing a CSS selector which is then used to match a set of elements, or it accepts raw HTML creating a GQuery element containing those elements.

Usage

From source file:com.arcbees.gquery.tooltip.client.contactcell.ShowMorePagerPanel.java

License:Apache License

/**
 * Construct a new {@link ShowMorePagerPanel}.
 *//* w  w w. jav a 2 s .c o  m*/
public ShowMorePagerPanel() {
    init();

    // Handle scroll events.
    scrollable.addDomHandler(new ScrollHandler() {
        public void onScroll(ScrollEvent event) {
            // If scrolling up, ignore the event.
            int oldScrollPos = lastScrollPos;
            lastScrollPos = scrollable.getElement().getScrollTop();
            if (oldScrollPos >= lastScrollPos) {
                return;
            }

            HasRows display = getDisplay();
            if (display == null) {
                return;
            }
            int maxScrollTop = scrollable.getWidget().getOffsetHeight() - scrollable.getOffsetHeight();
            if (lastScrollPos >= maxScrollTop) {
                // We are near the end, so increase the page size.
                int newPageSize = Math.min(display.getVisibleRange().getLength() + incrementSize,
                        display.getRowCount());
                //all children will be replaced, ensure to destroy existing tooltip in order to avoid ghost
                // tooltips
                GQuery.$(".tooltipable", (Widget) display).as(Tooltip.Tooltip).destroy();
                display.setVisibleRange(0, newPageSize);
            }
        }
    }, ScrollEvent.getType());
}

From source file:org.bonitasoft.web.toolkit.client.ui.component.form.AbstractForm.java

License:Open Source License

public void resetErrors() {
    GQuery.$("div.alert_message", getElement()).remove();
}