IgGrid selectRow Issue

375 Views Asked by At

I am trying to implement the "RowSelectors" feature on the iggrid, but it will not change to a the next row.

On further inspection, i have got the selected row method and each row shows the same id. I am returning my data via ajax, if i use static json in a variable and use that as a datasource, it works as expected so not sure what the issue is..

 $("#selector").igGrid("selectedRow");

I can only acheive a row change when holding control and clicking..

Object {element: n.fn.init(1), index: 0, id: 3407751001}

then next row is

Object {element: n.fn.init(1), index: 1, id: 3407751001}

Settings..

features: [
    {
        name: "Sorting",
        columnSettings: [
            {
                columnIndex: 4,
                allowSorting: true,
                firstSortDirection: "ascending",
                currentSortDirection: "descending"
            }
        ]
    },
    {
        name: 'RowSelectors',
        enableCheckBoxes: true,
        checkBoxStateChanging: function (ui, args) {
            return false;
        },
        multipleSelection: true,
        rowSelectorClicked: function (evt, ui) {
            // Handle event  
        },
    },
    {
        name: 'Selection'
    }
]
1

There are 1 best solutions below

0
On

The issue is already resolved, but I'm adding the answer so it doesn't stay unanswered.

The primaryKey column the igGrid uses needs to be a column with unique identifiers for each record.