Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Text selection in expanded ListGrid

    Hi there.

    I have here another (stupid?) question and I hope that this time will someone help me :)

    So - imagine simple ListGrid with expansionMode set to DETAILS. Now, expand one record and try select some text from expanded field. It's not possible. So the question is simple - what I have to do to make it possible?

    setCanSelectText(true) = no effect
    setCanDragSelectText(true) = I can select text from record "header" but not from the expanded component (from that detail)

    Very simple test case:
    Code:
    	ListGridRecord[] records = new ListGridRecord[10];
    	for (int a = 0; a < 10; a++){
    		records[a] = new ListGridRecord();
    		records[a].setAttribute("itemName", "Lorem ipsum... " + a);
    	}
    	
    	ListGrid listGrid = new ListGrid();  
    	listGrid.setWidth(600);  
    	listGrid.setHeight(500);  
    	listGrid.setCanExpandRecords(true);  
    	listGrid.setExpansionMode(ExpansionMode.DETAILS);  
    	listGrid.setCanSelectText(true);
    	listGrid.setCanDragSelectText(true);
      
    	ListGridField itemNameField = new ListGridField("itemName");  
      
    	listGrid.setFields(itemNameField);  
    	listGrid.setData(records);
      
    	listGrid.draw();
    Desired behavior can be "presented" on showcase example, opened in Opera browser (http://www.smartclient.com/smartgwt/...anding_details) - no setter used and still it's possible to select whatever I want...

    SmartGWT: 2.5

    #2
    Those are the right settings (canSelectText) on the wrong component (the ListGrid as a whole rather than the generated DetailViewer). Override getExpansionComponent() to return your specially configured DetailViewer instead.

    Comment


      #3
      @Isomorphic: Thank you very much!! Forty virgins for you :D

      Comment


        #4
        It works like a charm! Thank you very much!

        Comment

        Working...
        X