[CLOSED] GridFilters feature messes with Paging/Sorting?

  1. #1

    [CLOSED] GridFilters feature messes with Paging/Sorting?

    Hi,

    This seems like a difficult to reproduce behavior or bug. My code sample is definitely suffering from it on a more consistent basis but I've been trying to see if any demo is affected. Please check the GridFilters Local demo at https://examples2.ext.net/#/GridPane...Filters_Local/. Click on the ID header twice. Page to the next page until you reach the last page. Notice that ID 27 is at the very bottom despite the sort order being DESC. Page back to the first page and notice that ID of 1 is at the top despite the descending sort order.

    Remove the filters and notice how sorting and paging now work as designed.
    Last edited by Daniil; Jul 15, 2013 at 4:27 AM. Reason: [CLOSED]
  2. #2
    Hi Vadym,

    We recall such a bug.
    http://forums.ext.net/showthread.php?25172

    It should be fixed in SVN.

    Could you, please, try to reproduce it with the trunk?
  3. #3
    Hi Vladimir,

    Has it been fixed in branches or tags in SVN? I update the source code from http://svn.ext.net/premium/branches/2.2.

    Update:
    Never mind, I should probably get it from the trunk at http://svn.ext.net/premium/trunk
    Last edited by vadym.f; Jul 12, 2013 at 7:03 PM.
  4. #4
    No, it is in the trunk only. And it will go to the upcoming v2.3 release.
  5. #5
    Confirmed. That problem is gone from the trunk. However, I've spotted a new issue that didn't exist in the branches. Date model field and/or date column now misbehave displaying empty strings for valid dates. Please notice that my code and data have been unchanged between the switches from branches and trunk.

        <ext:Store runat="server" ID="Store1" PageSize="20" OnReadData="Store1_Refresh">
            <Model>
                <ext:Model ID="Model1" runat="server" IDProperty="ID">
                    <Fields>
                        <ext:ModelField Name="ID" Type="Int" />
                        <ext:ModelField Name="Code" Type="String" />
                        <ext:ModelField Name="CreatedDate" Type="Date" DateFormat="yyyy-MM-ddTHH:mm:ss" />
                    </Fields>
                </ext:Model>
            </Model>
            <Sorters>
                <ext:DataSorter Property="CreatedDate" Direction="DESC" />
            </Sorters>
        </ext:Store>
    <ext:GridPanel ID="GridPanel1" runat="server" StoreID="Store1">
                    <ColumnModel ID="ColumnModel1" runat="server">
                        <Columns>
                            <ext:Column ID="Code" runat="server" Width="180" Text="Code" DataIndex="Code" />
                            <ext:DateColumn ID="CreatedDate" runat="server" Width="160" Text="Created Date" DataIndex="CreatedDate"
                                Format="yyyy-MM-ddTHH:mm:ss" />
                        </Columns>
                    </ColumnModel>
                    <Features>
                        <ext:GridFilters runat="server" Local="true">
                            <Filters>
                                <ext:DateFilter DataIndex="CreatedDate">
                                    <DatePickerOptions runat="server" TodayText="Now" />
                                </ext:DateFilter>
                            </Filters>
                        </ext:GridFilters>
                    </Features>
    </ext:GridPanel>
  6. #6
    It's turned out that the model field DateFormat option isn't very robust after all. I've had to modify my T-SQL SELECT query in order to chop off milliseconds. DateFormat="yyyy-MM-ddTHH:mm:ss" doesn't recognize a value as valid date if it has trailing non-zero milliseconds. For instance, this date would be displayed as empty in my setup:

    2011-07-17 13:25:41.123

    I've tried to alter the DateFormat following MS suggestions at http://msdn.microsoft.com/en-us/library/bb882581.aspx but it never worked. As I said earlier, a T-SQL workaround truncating milliseconds eventually did the trick but it's obviously not what you want to do to fix the UI.

    SELECT CONVERT(datetime, CONVERT(char(19), getdate(), 126))
  7. #7
    Are you sure that DateFormat is required in your case? If you remove DateFormat then does it work?

    In any way, such format ("yyyy-MM-ddTHH:mm:ss") cannot parse date with milliseconds
    To support milliseconds you should use "yyyy-MM-ddTHH:mm:ss.fff"
  8. #8
    Indeed, DateFormat wasn't necessary and it works well without it. I couldn't get milliseconds to display with your suggestion though. Somehow, .fff is recognized as string literal.

    Update:
    Based on the client side formatCodes enumerator defined in ext-all-dev.js file, the date format to capture milliseconds should read

    Format="yyyy-MM-ddTHH:mm:ss.u"
    or

    Format="yyyy-MM-dd HH:mm:ss.u"
    It worked for me.
    Last edited by vadym.f; Jul 12, 2013 at 9:24 PM.
  9. #9
    I guess this also might work in your case.
    <ext:ModelField Name="CreatedDate" Type="Date" RenderMilliseconds="true" />
  10. #10
    Quote Originally Posted by Daniil View Post
    I guess this also might work in your case.
    <ext:ModelField Name="CreatedDate" Type="Date" RenderMilliseconds="true" />
    Thanks Daniil! It works in the sense that date time literals with non-zero milliseconds like 2011-07-17 13:25:41.123 get displayed correctly. To actually view the milliseconds, I still need to define the Format property on the DateColumn:

    Format="yyyy-MM-dd HH:mm:ss.u"

Similar Threads

  1. Grouping Feature with Custom sorting
    By glenh in forum 2.x Help
    Replies: 0
    Last Post: Jun 20, 2013, 5:44 AM
  2. Paging and sorting Page example not working
    By kavit@bdtpark.com in forum 2.x Help
    Replies: 1
    Last Post: May 21, 2013, 4:38 AM
  3. Paging and Sorting
    By Maia in forum 1.x Help
    Replies: 2
    Last Post: Sep 15, 2011, 1:51 PM
  4. Replies: 1
    Last Post: Sep 05, 2011, 5:52 AM
  5. [CLOSED] [1.0] RowEditor incompatible with GridFilters and Paging
    By kemalyigit in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 06, 2010, 9:21 AM

Tags for this Thread

Posting Permissions