select

select([selector]) - Gets or sets the table rows (or cells) which are selected.

The following example shows how to select the first and second table rows:

$("#grid").shieldGrid({
    dataSource: {
        data: [
            { ID: 1, name: "name1" },
            { ID: 2, name: "name2" }
        ]
    },
    selection: {
        type: "row",
        multiple: true,
        toggle: false
    },
    columns: [
        { field: "ID" },
        { field: "name" }
    ]
});

$("#grid").swidget().select("tr:eq(0), tr:eq(1)");

The following example shows how to select the first table cell:

$("#grid").shieldGrid({
    dataSource: {
        data: [
            { ID: 1, name: "name1" },
            { ID: 2, name: "name2" }
        ]
    },
    selection: {
        type: "row",
        multiple: true,
        toggle: false
    },
    columns: [
        { field: "ID" },
        { field: "name" }
    ]
});

$("#grid").swidget().select("td:eq(0)");

The following example shows how to get the selected table row:

$("#grid").shieldGrid({
    dataSource: {
        data: [
            { ID: 1, name: "name1" },
            { ID: 2, name: "name2" }
        ]
    },
    selection:  {
        type: "row",
        multiple: true,
        toggle: false
    },
    columns: [
        { field: "ID" },
        { field: "name" }
    ]
});

var grid = $("#grid").swidget();
grid.select("tr:eq(0)");
var row = grid.select();