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

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

Introduction

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

Prototype

public GQuery empty() 

Source Link

Document

Remove all child nodes from the set of matched elements.

Usage

From source file:be.dramaix.ai.slidingpuzzle.client.Puzzle.java

License:Apache License

public void loadState(State s) {

    GQuery puzzle = SELECTOR.getPuzzleBoard();
    puzzle.empty();

    byte[] board = s.getAllCells();

    for (int i = 0; i < board.length; i++) {
        byte value = board[i];
        GQuery cell = $("<div class='tile'></div>");
        if (value == 0) {
            cell.addClass("empty");
        } else {//from w  w w.ja  v a  2s  .c om
            cell.html("" + value);
        }
        puzzle.append(cell);

    }

    //
    int puzzleDimension = TILE_DIMENSION * dimension;
    puzzle.height(puzzleDimension).width(puzzleDimension);
}