Announcement

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

    ListGrid horizontal scroll /w many fields don't show all columns

    Hi, we have an application composed of two main grids, from those two grids, we can create as many new grids as we require through an n:n relationship between the two table; the third grid being the data in that n:n table. We are using PHP as backend, so no RPC or stuff like that. So we create our third datasource from the two first datasource, to which we add a few other ones.

    So far, the first two grids appear and behave normally, but the third grid is not. The horizontal scroll bar seems to fit the correct data width, but when the data is loaded completely, it shrinks to reveal only a part of the grid. And we need to resize the last columns and "wiggle" with the scroll bar for it to reveal the "hidden" columns.

    We are using a base class for all our grid, so this shouldn't happen (it works for the first two...). Here is the constructor :

    Code:
    public AbstractGrid(Criteria crit, Menu contextMenu) {
    	this.crit = crit;
    	setWidth100();
    	setHeight100();
    	setShowAllRecords(true);  
    	setUseAllDataSourceFields(true);
    	setSelectionType(SelectionStyle.MULTIPLE);
    	setShowRollOver(false);
    	setModalEditing(true);
    	setEditByCell(true);
    	setEditEvent(ListGridEditEvent.DOUBLECLICK);
    	setListEndEditAction(RowEndEditAction.NEXT);
    	setAutoSaveEdits(false);
    	setCanFreezeFields(true);
    	//setAutoFitData(Autofit.BOTH);
    	//setAutoFitMaxColumns(3000);
    		
    	setResizeFieldsInRealTime(false);
    		
    	setMinFieldWidth(100);
    		
    	setShowFilterEditor(true);
    	setFilterOnKeypress(true);
    		
    	setConfirmDiscardEdits(true);
    	setConfirmDiscardEditsMessage( I18N.confirmDiscardEditsMessage() );
    		
    	if (null != contextMenu ) {
    		setContextMenu( contextMenu );
    	}
    		
    	if (null != crit) {
    		setInitialCriteria(crit);
    	}
    		
            setAutoFetchData(true);
        
            this.listener = new GridHeadersResponseListener();
            
            refreshColumns();
    }
    The method refreshColumns() fetch a JSON object from the server, create the grid's field headers from it and then fetch the data from the datasource (this.fetchData())

    Like I said, all the other two grids work fine. There are 36 columns from the first datasource, and 4 from the second. The datasource for the third grid is created from a RestDataSource, and we despite that we are using the same rows from the first two datasource, the third datasource is not dependant of any other datasource.

    In attachement, I provided the screenshot of what I see. The first is when the data loads; the horizontal scroll bar seems to be alright. The second is when the data is finished loading; the horizontal scrollbar have shrunk and doesn't let the user scroll past the 18th column.

    We have tried using setAutoFitData and all this, but the scroll bars then appears outside the grid and this is undesirable.

    Can someone help me with this?
    Attached Files

    #2
    Hi - I had a similar problem, for which I found a fix (kludge?)

    Hello -

    I'm not sure if the problem I was having is the same as yours - but I was experiencing a situation where a ListGrid would display too narrow.

    I fixed it by changing:

    setWidth100();

    to:

    setWidth(600);

    (or some other number).

    The thread is here:

    http://forums.smartclient.com/showthread.php?t=9830

    I don't know if this is the same problem you were having - but it may be somewhat related.

    Comment


      #3
      I thought of that, and I had tried to remove the setWidth100() yesterday after I posted this comment with the same result. I just tried setting a fixed width, but still the grid is too narrow and display now even less columns (too narrow+hscroll's max value even smaller)

      I wish that would have been the solution :(

      Comment

      Working...
      X