Announcement

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

    ListGrid with canExpandRecords: how to expand only few records, not all

    Hello, dear SmartGWT developers!

    I'm using this code:
    Code:
    ListGrid listGrid = new ListGrid();  
    listGrid.setWidth100();  
    listGrid.setHeight("50%");  
    listGrid.setShowAllRecords(true);
    listGrid.setAlternateRecordStyles(true);
    listGrid.setCanExpandRecords(true);  
    listGrid.setExpansionMode(ExpansionMode.DETAILS);
    
    ListGridField typeField = new ListGridField("type", "Type", 200);  
    ListGridField subtypeField = new ListGridField("subtype", "Subtype", 200);  
    ListGridField valueField = new ListGridField("value", "Value", 150);
    ListGridField descriptionField = new ListGridField("desrc", "Description", 500);
    
    listGrid.setFields(new ListGridField[] {typeField, subtypeField, valueField, descriptionField});        
    listGrid.setCanResizeFields(true);
    But having this code, I see in my rows 4 columns. And also I see the same columns in expanded details. Instead I want to see in rows only typeField and subtypeField, but in details the remaining two: valueField and descriptionField.

    How can I achieve it? I was searching for something like ListGridField.setExpandable() or ListGrid.setExpandableFields(), but found nothing similar.

    Thank you very much in advance!

    #2
    I'm sorry for bothering, but if there is a setting please suggest me how to turn it on...

    I really don't see it :(

    In the showcase you initialize such a grid using datasource, but I don't have datasourse, and therefore can't see my ListGrid has expandable records :(

    Thank you in advance one more time.
    Last edited by J-Pro; 10 Dec 2010, 12:26.

    Comment


      #3
      Sorry for posting here again, but I'm just using the moment that Isomorphic is online and can answer posts :)

      Can you please help me with this issue also?

      Comment


        #4
        I've found the "Memo rows" example, where I can select one field to be expanded:
        Code:
        listGrid.setExpansionMode(ExpansionMode.DETAIL_FIELD);  
        listGrid.setDetailField("background");
        But how to make more than one field to be shown in ExpansionMode.DETAILS mode?
        Is there such a way and you just don't want to tell for some reason, or there is no such way yet? Please answer to me to know which approach to use.

        Thanks.

        Comment

        Working...
        X