0

<rant>I'm getting downright frustrated with the lack absence of documentation for SlickGrid.</rant>

Sorry -- now that that's out of my system . . .

I'm trying to figure out the correct syntax for returning a value in a cell in a row. For example, let's say I have the following data:

ID   Object      Color
1    This        Red
2    That        White
3    OtherThing  Blue

I want to do something similar to this (I'll use the onMoveRows event as an example):

grid.onMoveRows = function (rows, insertBefore) {
    for (var i = 0; i < rows.length; i++) {
        if (rows[i].Color == "Blue") {
            // do something
            }
    }
};

The rows[i].Color == "Blue" is my issue. I don't know the proper syntax for this (or even if this is possible), I can't find it documented anywhere, and I don't want to waste my time trying to figure it out (I've already spent a couple of hours trying to do so).

Can someone clue me in?

Thanks in advance . . .

Ray K.
  • 2,431
  • 3
  • 25
  • 39
  • Think my ignorance of JavaScript might be showing (too used to VBScript). Looking into JavaScript array objects . . . – Ray K. May 31 '12 at 18:21
  • I found what I was looking for [here](http://stackoverflow.com/questions/4769286/how-do-i-return-a-specific-cell-value-in-slickgrid). – Ray K. May 31 '12 at 19:11

1 Answers1

1

'rows' is an array of row numbers that are being moved.
For example, if you selected rows 1,2 and 5, the 'rows' will contain [0,1,4] (it's 0-based).

Tin
  • 9,082
  • 2
  • 34
  • 32
  • That's helpful. I thought "rows" was an object array containing row data. I wasn't aware that it was just a number array. That's why I was having trouble with it. – Ray K. May 31 '12 at 19:51