1. #371
    Ext JS Premium Member
    Join Date
    May 2008
    Posts
    328
    Vote Rating
    1
    ttbgwt is on a distinguished road

      0  

    Default


    Does this work with 4.2?

  2. #372
    Sencha User
    Join Date
    Apr 2013
    Posts
    9
    Vote Rating
    0
    JNickVA is on a distinguished road

      0  

    Default Multiple C# Views loaded from ExtJS

    Multiple C# Views loaded from ExtJS


    My ASP.NET MVC3/ExtJS application requires multiple Views that need to be maintained as C# code. What would be the best way to use these Views from the client-side ExtJS? Can a Ext.Direct call to a Controller Action, which returns a View, be used? What would the syntax be in the ExtJS code? If this isn't the best way to accomplish the task, what is? The way I see this working is for each C# View to have a <script> tag to load the ExtJS .js file for the client-side code.

  3. #373
    Sencha User
    Join Date
    Dec 2012
    Posts
    1
    Vote Rating
    0
    NicoExtForum is on a distinguished road

      0  

    Default


    Hi,
    it seems we found an issue using the lastest version in a non "en-Us" environnement : when used to call a method with a Date parameter, Ext.Direct.Mvc return an invalid date or an exception when parsing the String : this problem occurs with the basic sample included with the source.

    After looking at the source code, it seems the issue occurs in ReadJson method of the RequestDataConverter class where each JValue sent from the client are converted to string : if the JValue contains a DateTime the toString must specify the InvariantCulture to avoid parsing issue in the DirectValueProvider. To resolve the problem we've only add a check if the value is an IFormattable. Hence the following modification in the ReadJson method resolves the problem :

    Code:
    if (value is IFormattable)
    {
        data.Add(value == null ? null : ((IFormattable)value).ToString(null,CultureInfo.InvariantCulture));
    }
    else
    {
        data.Add(value == null ? null : value.ToString());
    }