Hi There
I would like to combine the row selection in the WebGrid with the menu pop up. Is there any chance to detect and render the menu options based on the user selection? As in before selection there may be x items in the menu and only if there is a row selected two more menu options will appear ( to view and edit that row)
For example is there a way to do something similar to the below:
<ig:menu id="popup1" popup="true" orientation="vertical"> <ig:menuItem value="Edit This Derivative" iconUrl="/resources/blank.gif"/> <ig:menuItem value="Create New" /> <ig:menuItem value="Go ElseWhere" />
<% if ( Something.getRowSelected() != null){
<ig:menuItem value="View This Row" "/> <ig:menuItem value="Edit This Row" /> <ig:menuItem value="Delete This Row" />
}
%>
</ig:menu>
Of course this means that the menue component is refreshed upon each selection
any idea?
Many thanks in advance
Shai Koren
Hello Shai,
You can handle the SelectedRowsChangeListener on the grid and check if there are rows selected in the grid, then you can add/remove items to the webmenu accordingly. In addition, you will have to add the WebMenu to the smart refresh manager so that the changes made on the server updates the menu on the client.
{
List selectedRows = grdControl.getSelectedRows();
if(selectedRows.size() > 0)
//Add Extra Items to Menu
else
//Remove Extra Items from Menu
//Add the client ID of the menu to the smart refresh manager to that it is updated on the client.
SmartRefreshManager srf = SmartRefreshManager.getCurrentInstance();
Hope this helps.
-Taz.
Hi Taz,
I have a similar issue. Basically I am using in Cell editing grid of Infragistics. I want to know the row on which the change is made (i.e the value of the each cell for which the change is made). Please sight ways as how to detect the rows without using checkboxes.
Further can you please detail me on the steps to implement SelectedRowsChangeListener (precisely how to register).
From the website I got these details "A listener interface for receiving RowSelectEvent. A class that is interested in receiving such events implements this interface, and then registers itself with the component by calling addRowSelectListener()."
Thanks in advance
Kaushal