Skip to content

Row object not returned correctly when using row identifier #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
philwig opened this issue Jul 21, 2015 · 1 comment · May be fixed by #280
Open

Row object not returned correctly when using row identifier #175

philwig opened this issue Jul 21, 2015 · 1 comment · May be fixed by #280

Comments

@philwig
Copy link

philwig commented Jul 21, 2015

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.

@EdwardsNick EdwardsNick linked a pull request Apr 11, 2016 that will close this issue
@EdwardsNick
Copy link

@philwig

See pull request #280

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants