Skip to content

Row object not returned correctly when using row identifier #175

@philwig

Description

@philwig

If you have a click handler on a row, the row object a list of columns are returned by the Bootgrid click handler. That's all good.

If you then add a data-identifier parameter to some field, to use as the row ID.... the row is then returned from that same click handler as null. The reason is this pair of lines...

id = (that.identifier == null) ? $this.data("row-id") :  that.converter.from($this.data("row-id") + ""),

This one sets my ID up to be a string, say "4". The subsequent line...

row = (that.identifier == null) ? that.currentRows[id] :
                    that.currentRows.first(function (item) { return item[that.identifier] === id; });

compares for type and value with === against... the objects in the array. And that danged ID is plain old integer 4 in there. So it fails the comparision, as 4 !== "4".

I'm not quite sure what this is supposed to be doing, but a quick hack fix is to relax the test to make it an == check. That seems unsatisfying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions