How come the closure for addColumns does NOT pass the row index? #752
Unanswered
thedangler
asked this question in
Q&A
Replies: 1 comment
-
you can make a private variable say it "index" with default value is 1. on your return closure function $this->index++; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Wondering why when trying to manage columns you can't access the index of the record you are looping?
For example if doing a custom field
->addColumn('myCustomField', function($col){
// how do I get the current iteration of row?
});
// this would be nice. Unless there is a way to do it I can't find in the docs
->addColumn('myCustomField', function($col, $index){
// how do I get the current iteration of row?
});
Please not this is for a Collection.
Beta Was this translation helpful? Give feedback.
All reactions