Open GoogleCodeExporter opened 9 years ago
I really like this idea, and have heard it from multiple people.
The thing to figure out though - is that you can't always just add a blank row
with javascript. In a lot of case you need to set some data along with the new
row. Such as adding a new order for a user grid. You need to add a new row
WITH the userid and userid probably isn't on the grid cuz your on the user page.
So i need to figure that part out. It may be an ajax operation to get the
extra data then create the dirty row. But im not sure yet.
Original comment by s...@square-bracket.com
on 10 Apr 2011 at 3:16
The notion of adding a blank row should be handled in the ->add() callback. If
a primary key is needed, then getting that key should only occur on the actual
adding of the row, IMO. Although maybe you're thinking of an edge case that
I'm not considering.
What do you mean by adding a new order for a user grid? It would seem to me
that default values are already set, and if there is a primary key that needs
to be addressed/saved, you have a choice as the programmer to either do it
yourself or let the underlying DB handle it (via autoincrement, etc.)
Or am I missing the point?
If you HAD to get a derived value from the backend, then yes, a ajax operation
might be needed for initial population, although technically you're doing that
anyway via the ->select() editables (although not sure if you do a lookup every
time or load the lookup data once and then reuse it throughout the whole grid.
Original comment by vep....@gmail.com
on 12 Apr 2011 at 9:19
For example. Lets say I have a grid of videos that a user has permission to
view. So on the users page I have a grid of tutorials.
As an admin, i want to add a new video permission to that user. I can't just
add a null row to the user_permissions table. I have to also specify which user
i'm adding for. And the user_id is not on the grid, because your already on
the user's page.
So you see, I need to somehow pass extra data long when adding a new row,
because sometimes you have dependent data that needs to be set along with the
new null row.
Original comment by Seancla...@gmail.com
on 13 Apr 2011 at 4:49
Original issue reported on code.google.com by
vep....@gmail.com
on 8 Apr 2011 at 4:27