I am at my wits end again with something that should be basic, and other people make it work, but every time I try, I either get gobbledygook or errors.
All I want to do is step through the results of a search in a dataprovider, and make an array of the id attributes. This should be easy, but it appears to be arcane.
Say I have a model Balls. I want to search for all the red Balls, display the records in a CGridView, let the user select some of the records, then return the selected records and an array of ALL the ids to the BallsController. Should be easy, right? But I cannot for the life of me figure out how to step through the records in the dataprovider. I do not understand the structure of a CActiveDataProvider or how to access it. It appears from the class reference that the getData method should help, but I cannot get meaningful data out of that either.
Please somebody explain it to me.
Also, when you create a dataprovider, then pass it to a CGridView, when is the actual SQL search run? I gather the view script runs it, but in what method?
Thank you in advance to anyone who takes the time to explain all this to me.