Go Back   SmartClient Forums > Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 5th Dec 2008, 06:50
code08 code08 is offline
Registered Developer
 
Join Date: Jan 2008
Posts: 56
Default SmartClient 7.0 Beta Bug (maybe)

Using the 7.0 beta, the saveAllEdits callback on the ListGrid is only being fired IF there are pending edits. It seems like the callback should always be fired. I haven't gone back to 6.5 to see if the issue exists there or not.

We're using

Code:
list.saveAllEdits(null, function() {
     //our code here
});
If this is the correct behavior and the callback is only called when there are pending edits by design (I can't imagine that's correct), then is there an alternate function to determine if there are pending edits or not?
Reply With Quote
  #2  
Old 7th Dec 2008, 15:22
Isomorphic Isomorphic is offline
Administrator
 
Join Date: May 2006
Posts: 38,712
Default

We'll take a look at whether something has changed here, but note you can check for pending edits by just calling grid.hasChanges().

Last edited by Isomorphic; 7th Dec 2008 at 15:30..
Reply With Quote
  #3  
Old 8th Dec 2008, 10:46
Isomorphic Isomorphic is offline
Administrator
 
Join Date: May 2006
Posts: 38,712
Default

Hi
Yes - this is the expected behavior and existed in previous releases.
We're adding docs to the method that more explicitly explain how hasChanges() / rowHasChanges() can be used to catch the case where this method will no-op. This should make this less confusing in the future.

Thanks
Isomorphic Software
Reply With Quote
  #4  
Old 8th Dec 2008, 15:25
code08 code08 is offline
Registered Developer
 
Join Date: Jan 2008
Posts: 56
Default

It would seem better if the callback always fired, otherwise we would have to wrap the saveAllEdits around a hasChanges if statement and put the same logic as in the callback in the else statement. What's the downside of always firing the callback?
Reply With Quote
  #5  
Old 8th Dec 2008, 15:57
Isomorphic Isomorphic is offline
Administrator
 
Join Date: May 2006
Posts: 38,712
Default

At this point, backwards compatibility (it's worked this way since the API was introduced). The code for the two cases differs fairly often, if it doesn't happen to differ for you, sorry for the inconvenience.
Reply With Quote
  #6  
Old 8th Dec 2008, 16:58
code08 code08 is offline
Registered Developer
 
Join Date: Jan 2008
Posts: 56
Default

I understand, we'll make it work. May I suggest you overload the method and accept an additional paramater for alwaysFireCallback that defaults to false. This would support backward compatibility and allow others like me a way to make sure code in the callback is always executed regardless of if there are pending edits or not.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


© 2010,2011 Isomorphic Software. All Rights Reserved