Announcement

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

    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?

    #2
    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; 7 Dec 2008, 15:30.

    Comment


      #3
      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

      Comment


        #4
        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?

        Comment


          #5
          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.

          Comment


            #6
            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.

            Comment

            Working...
            X