1. #211
    Ext JS Premium Member westy's Avatar
    Join Date
    Feb 2009
    Location
    Bath, UK
    Posts
    855
    Vote Rating
    38
    westy is a jewel in the rough westy is a jewel in the rough westy is a jewel in the rough

      0  

    Default


    Sent, cheers Evan!

  2. #212
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,657
    Vote Rating
    584
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #213
    Ext JS Premium Member westy's Avatar
    Join Date
    Feb 2009
    Location
    Bath, UK
    Posts
    855
    Vote Rating
    38
    westy is a jewel in the rough westy is a jewel in the rough westy is a jewel in the rough

      0  

    Default


    Excellent, I hope to get a chance to fork it and push my changes at some point over the weekend.

    As I say, I'd like to polish it more but it works

  4. #214
    Sencha User
    Join Date
    Jul 2010
    Posts
    1
    Vote Rating
    0
    krwo is on a distinguished road

      0  

    Default ComplexObjectConverter

    ComplexObjectConverter


    I think i found a bug in ComplexObjectConverter.ReadArray. It appears when there is array in array. For instance: [[1]] is deserialized as new object[]{ new object[]{ 1, null } }.
    Here's fix:
    private object[] ReadArray(JsonReader reader)
    {
    ArrayList output = new ArrayList();
    while (reader.Read())
    {
    if (reader.TokenType == JsonToken.EndArray)
    {
    return output.ToArray();
    }
    if (reader.TokenType == JsonToken.StartArray)
    {
    output.Add(ReadArray(reader));
    }
    else if (reader.TokenType == JsonToken.StartObject)
    {
    output.Add(ReadObject(reader));
    }
    else
    {
    output.Add(reader.Value);
    }
    }

    throw new JsonReaderException();
    }

  5. #215
    Ext JS Premium Member westy's Avatar
    Join Date
    Feb 2009
    Location
    Bath, UK
    Posts
    855
    Vote Rating
    38
    westy is a jewel in the rough westy is a jewel in the rough westy is a jewel in the rough

      0  

    Default


    I've got rid of the ComplexObjectConverter completely my updated version.

    It's not that polished yet, or properly tested (really need the official Ext 4 DirectProxy for that), but you can find it here if you want to try it.

    Working fine for my grids at present.

    There's also an updated version of Mitchell's DirectProxy there that does what I need wrt overriding the sorter, filter and group encoding.

  6. #216
    Sencha User
    Join Date
    Feb 2011
    Posts
    1
    Vote Rating
    0
    longsheng is on a distinguished road

      0  

    Default


    hi, evan
    In my project there is a version of Newtonsoft.Json.dll 4 , When I use the Ext.Direct.dll, An error occurred.

    I think the Ext.Direct should be more general, rather than relying on specific components.

    ps:English translation from Google,两句话用了我10分钟~呃

  7. #217
    Sencha User
    Join Date
    May 2011
    Posts
    4
    Vote Rating
    0
    BharatRathi is on a distinguished road

      0  

    Default Support for Ext Direct 4.x for .Net Router

    Support for Ext Direct 4.x for .Net Router


    Hi Evan,

    Are there any plans to update .Net Router to support Ext Direct 4.X ?

  8. #218
    Ext JS Premium Member westy's Avatar
    Join Date
    Feb 2009
    Location
    Bath, UK
    Posts
    855
    Vote Rating
    38
    westy is a jewel in the rough westy is a jewel in the rough westy is a jewel in the rough

      0  

    Default


    It's working fine for me with Ext 4.
    AFAIK the Ext.Direct spec has not changed.


    Thought would drop by here and highlight an issue I've just (hopefully) resolved though.
    We've been seeing occasional hanging of requests, and it's been proving very hard to reproduce. It seems to happen most often when demoing though, so it's not good.

    Believe I've just sorted it though (*fingers crossed*).
    The DirectProviderCache as was is not thread-safe. I've corrected in my version on github, slightly tweaking the interface to make it less dictionary like, and more provider cache like.

    Code:
    using System;
    using System.Collections.Generic;
    
    namespace Ext.Direct
    {
    
        /// <summary>
        /// Simple cache for Ext.Direct providers
        /// </summary>
        public class DirectProviderCache
        {
            #region Static members
            /// <summary>
            /// Our singleton instance.
            /// </summary>
            private static readonly DirectProviderCache _Instance = new DirectProviderCache();
    
            /// <summary>
            /// Our cache of providers.
            /// </summary>
            private static Dictionary<string, DirectProvider> _Providers = new Dictionary<string, DirectProvider>();
    
            /// <summary>
            /// Our locking object.
            /// </summary>
            private static object _SyncLock = new object();
            #endregion
    
            #region Static constructor
            /// <summary>
            /// Static constructor prevent class being marked with BeforeFieldInit.
            /// </summary>
            static DirectProviderCache()
            {
            }
            #endregion
    
            #region Static properties
            /// <summary>
            /// Gets the singleton instance of this object.
            /// </summary>
            /// <returns>The DirectProviderCache instance.</returns>
            public static DirectProviderCache GetInstance()
            {
                return _Instance;
            }
            #endregion
    
            #region Indexers
            /// <summary>
            /// Allows providers to be retrieved from the cache.
            /// </summary>
            /// <param name="providerName">The name of the provider to retrieve.</param>
            /// <returns>The DirectProvider, or null if not found.</returns>
            public DirectProvider this[string providerName]
            {
                get
                {
                    if (this.ContainsProvider(providerName))
                    {
                        return _Providers[providerName];
                    }
    
                    return null;
                }
            }
            #endregion
    
            #region Public methods
            /// <summary>
            /// Determines whether this cache contains the specified provider.
            /// </summary>
            /// <param name="providerName">The name of the provider to look for.</param>
            /// <returns><b>true</b> if our cache contains the provider, <b>false</b> otherwise.</returns>
            public bool ContainsProvider(string providerName)
            {
                return _Providers.ContainsKey(providerName);
            }
    
            /// <summary>
            /// Adds a provider to the cache.
            /// </summary>
            /// <param name="provider"></param>
            public void Add(DirectProvider provider)
            {
                if (provider == null)
                {
                    throw new ArgumentNullException("provider");
                }
    
                // Double lock checking...
                if (!this.ContainsProvider(provider.Name))
                {
                    lock (_SyncLock)
                    {
                        if (!this.ContainsProvider(provider.Name))
                        {
                            _Providers.Add(provider.Name, provider);
                        }
                    }
                }
            }
            #endregion
        }
    }
    Cheers,
    Westy
    Product Architect
    Altus Ltd.

  9. #219
    Sencha User
    Join Date
    Mar 2010
    Location
    Modena, Italy
    Posts
    59
    Vote Rating
    1
    gianmarco is on a distinguished road

      0  

    Default


    Quote Originally Posted by BharatRathi View Post
    Hi Evan,

    Are there any plans to update .Net Router to support Ext Direct 4.X ?
    ExtDirectHAndler (http://gimmi.github.com/extdirecthandler/) has been developed against ExtJS 4 and has support for named parameter that AFAIK is the only new feature introduced with Ext.Direct 4

  10. #220
    Ext JS Premium Member westy's Avatar
    Join Date
    Feb 2009
    Location
    Bath, UK
    Posts
    855
    Vote Rating
    38
    westy is a jewel in the rough westy is a jewel in the rough westy is a jewel in the rough

      0  

    Default


    Quote Originally Posted by gianmarco View Post
    ExtDirectHAndler (http://gimmi.github.com/extdirecthandler/) has been developed against ExtJS 4 and has support for named parameter that AFAIK is the only new feature introduced with Ext.Direct 4
    Oh, not seen this before... I'll take a look
    Product Architect
    Altus Ltd.