PDA

View Full Version : [FIXED] [V0.8.0] When a Store initially receives empty data...



jxlarrea
Feb 10, 2009, 9:33 PM
When the first datasource of a Store is empty it no longer works even if it is rebound with a collection. The error received is "this.getTotal is not a function".

The problem is exactly as described in the following thread:

http://forums.ext.net/showthread.php?832

There it says it was fixed, but i downloaded a couple of days ago the Coolite assembly and the issue remains.

Any ideas?

Vladimir
Feb 11, 2009, 6:46 AM
 Hi,

Can you post the code which reproduce this error? We tested code from original post and it appears to work correctly.

jxlarrea
Feb 11, 2009, 12:31 PM
Looks like it doesn't work when the datasource is a Linq IQueryable collection.

For example:



Store2.DataSource = db.AddressBookContacts.Skip(e.Start).Take(e.Limit) ;


This returns a generic <AddressBookContact> collection and if it is empty, the bug arises. Even if i call any of the following, it still fails:



db.AddressBookContacts.Skip(e.Start).Take(e.Limit) .ToList();

OR

db.AddressBookContacts.Skip(e.Start).Take(e.Limit) .ToArray();


BUT curiously, if i create a generic List<AddressBookContact> collection and set is as a datasource, even if it's empty, it works.

Right now i'm using that as a workaround, if the db.AddressBookContacts query doesnt return any items, i just set the datasource as a new empty List<AddressBookContact> collection.



Store2.DataSource = new List<AddressBookContact>();


Weird thing, at least i found a workaround.

Vladimir
Feb 11, 2009, 1:59 PM
Hi,

Thanks, I was able to reproduce the error. The bug was fixed and committed.