SmartClient Version: v9.1p_2016-04-09/Pro Deployment (built 2016-04-09)
Tried on Chrome Version 49.0.2623.110 m & Firefox 26.0
I have an issue scrolling a TextAreaItem that appears in an expansion component of a ListGrid record. When the grid contains a single record (and therefore the grid has no scrollbar) the mouse wheel scrolling affects the nested TextAreaItem (as I am expecting). However with many rows in the grid (my example has 500) I cannot make the mouse wheel scroll the TextAreaItem within the list grid row. It always scrolls the ListGrid results set instead. I have tried multiple ways of trying to shift the focus to the TextAreaItem to scroll this component, rather than scrolling the ListGrid, to no avail.
Is there a solution to this, or will the mouse wheel always scroll the ListGrid if it has a scrollbar, regardless of where I set the focus in the nested expansion component?
Tried on Chrome Version 49.0.2623.110 m & Firefox 26.0
I have an issue scrolling a TextAreaItem that appears in an expansion component of a ListGrid record. When the grid contains a single record (and therefore the grid has no scrollbar) the mouse wheel scrolling affects the nested TextAreaItem (as I am expecting). However with many rows in the grid (my example has 500) I cannot make the mouse wheel scroll the TextAreaItem within the list grid row. It always scrolls the ListGrid results set instead. I have tried multiple ways of trying to shift the focus to the TextAreaItem to scroll this component, rather than scrolling the ListGrid, to no avail.
Is there a solution to this, or will the mouse wheel always scroll the ListGrid if it has a scrollbar, regardless of where I set the focus in the nested expansion component?
Code:
import java.util.ArrayList; import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.events.MouseOverEvent; import com.smartgwt.client.widgets.events.MouseOverHandler; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.TextAreaItem; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.tab.Tab; import com.smartgwt.client.widgets.tab.TabSet; /** * Title: Test<br> * Description: Sandbox for testing stuff<br> */ public class Test implements EntryPoint { /** * {@inheritDoc} */ @Override public void onModuleLoad() { SC.showConsole(); final ListGrid grid = new ListGrid() { @Override protected Canvas getExpansionComponent( ListGridRecord record ) { TabSet tabSet = new TabSet(); tabSet.setHeight( 300 ); tabSet.setWidth100(); Tab tab = new Tab("A tab"); // If this widget has a scrollbar, I want the mousewheel movement to scroll this widget, not the ListGrid TextAreaItem textArea = new TextAreaItem("focusOfScrolling", "Desired Scroll Focus"); textArea.setHeight(200); textArea.setWidth("*"); textArea.setValue( VERY_LONG_STRING ); final DynamicForm form = new DynamicForm(); form.setFields( textArea ); form.addMouseOverHandler( new MouseOverHandler() { @Override public void onMouseOver( MouseOverEvent event ) { form.focus(); } }); tab.setPane(form); tabSet.setTabs( tab ); VLayout layout = new VLayout(); layout.setWidth100(); layout.setHeight100(); layout.addMember( tabSet ); return layout; } }; grid.setCanExpandRecords( true ); grid.setCanExpandMultipleRecords( true ); grid.setFields( new ListGridField("a") ); ArrayList<ListGridRecord> records = new ArrayList<ListGridRecord>(); for ( int i=0; i<500; i++) { ListGridRecord record = new ListGridRecord(); record.setAttribute("a", "something"); records.add( record ); } grid.setData( records.toArray( new ListGridRecord[records.size()]) ); grid.setWidth100(); grid.setHeight100(); Canvas layout = new Canvas(); layout.setWidth100(); layout.setHeight100(); layout.addChild(grid); layout.show(); } private static final String VERY_LONG_STRING = "long string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string long string long string long string long " + "string long string long string long string long string long string long string long string "; }
Comment