function sqGridGraphicalCheckbox(grid, rowIndex, colIndex, row, params) {
    var isChecked = false;

    if ("checkedWidgets" in grid.rows[rowIndex].userData && colIndex in grid.rows[rowIndex].userData.checkedWidgets && grid.rows[rowIndex].userData.checkedWidgets[colIndex] == true) {
        isChecked = true;
    }

    var isDisabled = false;
    if (row.disabled) {
        isDisabled = true;
    }
    if (grid.getCellCustomData(rowIndex, colIndex, "cellsDisabled")) {
        isDisabled = true;
    }

    IncrementalDOM.elementOpenStart('div');
    IncrementalDOM.attr("class", "grid-widget-checkbox");
    IncrementalDOM.attr("onmousedown", function (event) {
        event.stopPropagation();
        var elementCheckbox = null;
        if (event.target.tagName == "INPUT") {
            elementCheckbox = event.target;
        }
        else if (event.target.tagName == "LABEL") {
            elementCheckbox = event.target.parentElement.children[0];
        } else if (event.target.children[0].tagName == "INPUT") {
            elementCheckbox = event.target.children[0];
        }
        else {
            elementCheckbox = event.target.children[0].children[0];
        }
        if (!("checkedWidgets" in grid.rows[rowIndex].userData)) {
            grid.rows[rowIndex].userData.checkedWidgets = {};
        }
        grid.rows[rowIndex].userData.checkedWidgets[colIndex] = !elementCheckbox.checked;
        grid.bodyRedraw();

        sqGridSendEvent(event, "checkboxChecked", rowIndex, colIndex, !elementCheckbox.checked);
    });
    IncrementalDOM.elementOpenEnd('div');

    IncrementalDOM.elementOpenStart('div');
    IncrementalDOM.attr("class", "sq-checkbox");
    IncrementalDOM.elementOpenEnd('div');

    IncrementalDOM.elementOpenStart('input');
    IncrementalDOM.attr("type", "checkbox");
    if (isDisabled) {
        IncrementalDOM.attr("disabled", "disabled");
    }
    IncrementalDOM.attr("onclick", function (event) {
        event.preventDefault();
    });
    IncrementalDOM.elementOpenEnd('input');
    var currentElement = IncrementalDOM.currentElement();
    currentElement.checked = isChecked;
    IncrementalDOM.elementClose('input');

    IncrementalDOM.elementOpenStart('label');
    IncrementalDOM.attr("onclick", function (event) {
        event.preventDefault();
    });
    IncrementalDOM.attr("onmousedown", function (event) {
        event.preventDefault();
    });
    IncrementalDOM.elementOpenEnd('label');
    IncrementalDOM.elementClose('label');

    IncrementalDOM.elementClose('div');
    IncrementalDOM.elementClose('div');
}