Manually refreshes a displayed grid.
ColdFusion.Grid.refresh(name
[,preservePage
])
cfgrid, ColdFusion.Grid.getGridObject, ColdFusion.Grid.sort, "Using HTML format grids" in the ColdFusion Developer's Guide
ColdFusion 8: Added this function
Parameter |
Description |
---|---|
name |
The value of the name attribute of the cfgrid tag to refresh. |
preservePage |
A Boolean value specifying whether to redisplay the current page of data (true), or display the first page of data (false, the default). This attribute applies only if the grid data requires multiple grid pages to display. |
This function does not return a value.
This function is useful to refresh a grid when an event occurs that changes the underlying data but does not normally trigger a grid update.
The following code snippet comes from an example that lets users delete rows from a grid. When the user selects a grid row and clicks the delete button, the AJAX proxy calls a mycfc.deleteRow function to delete the row from the database. When the function returns successfully, the proxy calls ColdFusion.Grid.refresh to update the grid and remove the row.
<cfajaxproxy bind="cfc:mycfc.deleteRow({deletebutton@click},{mygrid.id@none}" onSuccess="ColdFusion.Grid.refresh('mygrid', true)">