function createActionLink(linkLabel, linkClass, eventName, arg1, arg2) {
    return '<a class="' + linkClass + '" onmousedown="sqGridSendEvent(event,\'' + eventName + '\', \'' + arg1 + '\', \'' + arg2 + '\');">' + linkLabel + '</a>';
}

function getActionLinkValue(value) {
    try {
        var linkObj = xmlToObject(value).find("a")[0];
        return linkObj.childNodes[0].nodeValue;
    } catch (err) {
        return value;
    }
}

function getSelectedRowIDs(sqGrid) {
    var ids = [];
    if (!sqGrid) return ids;

    var data = sqGrid.getSelectedRows().selectedRowsData;

    for (var i = 0; i < data.length; i++) {
        ids.push(data[i][0]);
    }

    return ids;
}

function updateConditionRowColors(grid, type, removeColIndex) {
    if(!grid) return;

    for (var i = 0; i < grid.getNumberOfRows(); i++) {
        // var use = sqGridCheckboxGetValue(grid, i, 0);
        var use = grid.isRowChecked(i);
        var classes = [use ? "black-text" : "gray-text"];

        if(grid.firstColIsId){
            var rowId = grid.getRowId(i);

            if (rowId !== -1 && rowId.indexOf('c') == 0) { //category row
                classes.push("category");
            }
        }

        if (type && type == 'wf' && use) {
            var passed = grid.getUserData(i, "passed");
            classes.push(passed ? "green-bg" : "red-bg");
        }

        if (valueFilled(removeColIndex)) {
            classes.push("remove-col");
        }

        grid.setRowClass(i, classes);
        grid.bodyRedraw();
    }
}