Announcement

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

    Issues with RestDataSource and transformResponse override issues

    Hello,

    I'm trying to override transformResponse from RestDataSource for a special error message, that should be showed as an isc.warn() instead of inline error.

    I tried to do this:

    Code:
    isc.RestDataSource.addProperties( {
    		transformResponse: function (dsResponse, dsRequest, data) {
    			var dsResponse = this.Super("transformResponse", arguments);
    			
    			if ( data.response.status == -4 && typeof( data.response.errors.all ) != 'undefined' )
    			{
    				isc.warn( data.response.errors.all );
    			}
    			
    			return dsResponse;
    		}
    	} );
    For some reason, status is always 0 and data is empty. Removing this from my code, make it work ok again.

    Is it the wrong way of overriding transformResponse?

    Thanks!
    Last edited by fernandomm; 5 Jul 2010, 13:52.
Working...
X