Announcement

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

    Dublicating ListGrid's loadingDataMessage after freezing of a column

    Hello.

    I've encounter an issue with ListGrid (I'm using version 7.0rc2).

    I've freezed a column and after that during reloading I can see two messages "loading data".
    You can see that at the screenshot: http://cid-966fa37146602c77.office.live.com/self.aspx/.Public/Pictures/sm^_listgrid^_loadmsg.png

    It doesn't depend on a browser used (tried Chrome && FF).

    Here's ListGrid's code:
    Code:
    var list = isc.ListGrid.create({
    	// View:
    	alternateRecordStyles: true,
    	leaveScrollbarGap: false,
    	emptyMessage: "No data",
    	loadingDataMessage : "Loading data...",
    	// Behavior:
    	selectionType: "single",
    	generateDoubleClickOnEnter: true,
    	contextMenu: listContextMenu,
    	// Data:
    	dataPageSize: 50,
    	autoFetchData: true,
    	dataSource: "datasource"
    });
    UPDATE:
    I've also tried SNAPSHOT-2010-07-20 version. There's the same behavior (two messages).
    Last edited by SDorogin; 21 Jul 2010, 10:37.

    #2
    So, what about that issue? Is it know bug, will it be fixed, are there workarounds ?

    I reload the shown ListGrid with this code:
    Code:
    		var criteria = filter.getValues();
    		list.fetchData(criteria);
    		list.invalidateCache();
    where filter is some DynamicForm for filtering.
    Last edited by SDorogin; 21 Jul 2010, 01:58.

    Comment


      #3
      Just a note: you do not need additional invalidateCache() after fetchData() - that will cause additional request to the server.

      Comment


        #4
        2marpetr: Yeah. I'm expirience that and can't understand the right use-case.

        There're written in docs: "In some cases fetchData() will not need to contact the server as the new criteria can be satisfied by performing a client-side filter against the currently cached set of data. You can determine whether criteria will cause a fetch by calling ResultSet.willFetchData(). "

        But I need to refresh data in ListGrid each time. So I write this code:
        Code:
        		var criteria = filter.getValues();
        		if (list.willFetchData(criteria)) {
        			list.fetchData(criteria);
        		} else {	
        			list.setCriteria(criteria);
        			list.invalidateCache();
        		}
        But willFetchData always returns 'true'. Even if following fetchData won't fetch server. Tried on today's build.
        But it seems to me I've found a solution:
        Code:
        	list.setCriteria(criteria);
        	list.invalidateCache();
        Thanks, anyway.

        Comment


          #5
          So what about the issue (dublicating loading message)?
          You can see it even in online sample http://www.smartclient.com/#largeValueMapSQL
          Freeze any column then sort to make grid to reload.

          Comment

          Working...
          X