Hey Ben,

First off, if you're allowing your user to manipulate multiple objects at once, you might consider using the multiple selection abilities of the DataGrid (allowMultipleSelection=true) and allow the user to select the rows that way.

Second, if the action of a button is effecting multiple objects, it probably makes sense to have that button outside of the item renderer. Anything on the renderer would be assumed to be related to the object being rendered (not the collection).

Either way, you should have your button fire off some event to set the delete operation in motion. The code that handles that event (hopefully on some kind of controller, not the item renderer), should check which objects are selected, and include them in the data to the service call.

If your button is placed outside of the item renderer, then it can have a reference to the DataGrid as a whole and be able to find it's selectedItems property.

Does that answer your question?

Cheers,
Lach


On 25/11/2006, at 6:05 AM, bsdensmore wrote:

I have a DataGrid column that is using an itemRenderer to place a
checkbox in the Grid. This will allow someone to select multiple rows
to delete. I'm slowly starting to understand how to implement an
itemRenderer but still unclear on a couple of things.

After the user selects the rows they want to delete they will hit a
"delete" button which then triggers a function in the itemRenderer.

Should I get which rows were checked then pass those back to a
function in the Main application and delete the necessary rows or
handle it all in the function that is called in the itemRenderer?

I'm not actually deleting rows but I am calling a function in a CFC to
update the rows in a database and set their state back to something else.

Thanks,
Ben

Reply via email to