Announcement

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

    [Bug] ListGrid filter editor date range picker breaks page

    Hello,

    I am trying to implement a date range picker for a data-bound list grid, but the picker throws a JS error when the mini calendar pops up. To reproduce, click the calendar filter, open a date picker, and try to pick a day on the calendar. It is possible I'm missing an import, but I don't know which one.

    SmartClient Version: v9.1p_2014-08-24/Pro Deployment (built 2014-08-24)
    Chrome Version: 45.0.2454.93 (64-bit)
    OS: OSX 10.10.4

    Console.log:
    Code:
    Uncaught TypeError: Cannot read property 'getFullYear' of undefinedisc_RelativeDateItem_showPicker @ ISC_Forms.js:2366_4.(anonymous function).icons.isc.addProperties.click @ ISC_Forms.js:2336isc_FormItem__iconClick @ ISC_Forms.js:1011isc_DynamicForm_handleItemClick @ ISC_Forms.js:504isc_DynamicForm_handleClick @ ISC_Forms.js:502isc_c_Class_invokeSuper @ ISC_Core.js:273isc_c_Class_Super @ ISC_Core.js:265_2.handleClick @ ISC_Forms.js:1314isc_c_EventHandler_bubbleEvent @ ISC_Core.js:1387isc_c_EventHandler_handleClick @ ISC_Core.js:1260isc_c_EventHandler__handleMouseUp @ ISC_Core.js:1249isc_c_EventHandler_handleMouseUp @ ISC_Core.js:1243isc_c_EventHandler_dispatch @ ISC_Core.js:1460(anonymous function) @ VM5504:3
    Test case reproducing the issue:
    Code:
    <html>
    <head>
    <script>var isomorphicDir="static/isomorphic/";</script>
    <script src="static/isomorphic/system/modules/ISC_Core.js"></script>
    <script src="static/isomorphic/system/modules/ISC_Foundation.js"></script>
    <script src="static/isomorphic/system/modules/ISC_Containers.js"></script>
    <script src="static/isomorphic/system/modules/ISC_Grids.js"></script>
    <script src="static/isomorphic/system/modules/ISC_Forms.js"></script>
    <script src="static/isomorphic/system/modules/ISC_DataBinding.js"></script>
    <script src="static/isomorphic/system/modules/ISC_PluginBridges.js"></script>
    <script src="static/isomorphic/system/modules/ISC_Drawing.js"></script>
    <script src="static/isomorphic/system/modules/ISC_Charts.js"></script>
    <script src="static/isomorphic/system/modules/ISC_Calendar.js"></script>
    <script src="static/isomorphic/skins/Enterprise/load_skin.js"></script>
    </head>
    <body>
        <script>
    
            isc.DataSource.create({
                titleField: "Name",
                allowAdvancedCriteria: true,
                ID:"myDS",
                fields: [
                    {
                        name: "Date",
                        type: "datetime",
                        canFilter: true
                    },
                    {
                        name: "Name",
                        type: "text",
                        canFilter: true
                    },
                    {
                        name: "Location",
                        type: "text",
                        canFilter: true
                    }
                ]
            });
    
            isc.ListGrid.create({
    
                ID: "listGrid",
                showFilterEditor: true,
                gridComponents: [
                    "header",
                    "filterEditor",
                    "body"
                ],
                width: "50%",
                height: "50%",
                dataSource: myDS,
                data: [
                    {"Date": "10/10/2015", "Name": "John", "Location": "San Francisco"},
                    {"Date": "10/11/2015", "Name": "Bob", "Location": "San Jose"},
                    {"Date": "10/11/2015", "Name": "Jen", "Location": "San Diego"},
                    {"Date": "10/10/2015", "Name": "Mary", "Location": "San Antonio"},
                    {"Date": "10/15/2015", "Name": "John", "Location": "Santa Rosa"},
                    {"Date": "10/15/2015", "Name": "Bob", "Location": "Santa Cruz"},
                    {"Date": "10/10/2015", "Name": "John", "Location": "San Juan Capistrano"},
                    {"Date": "10/15/2015", "Name": "Jen", "Location": "San Luis Obispo"},
                    {"Date": "10/10/2015", "Name": "Ken", "Location": "San Francisco"},
                ]
            });
        </script>
    </body>
    </html>

    #2
    Put Date instances in your data instead of strings

    Comment


      #3
      Originally posted by Isomorphic View Post
      Put Date instances in your data instead of strings

      Were you able to test this within my test case to verify it works? This didn't fix my issue.

      Here's the data variable that I changed:

      Code:
      data: [
                      {"Date": new Date(1443891872000), "Name": "John", "Location": "San Francisco"},
                      {"Date": new Date(1443891872000), "Name": "Bob", "Location": "San Jose"},
                      {"Date": new Date(1443891872000), "Name": "Jen", "Location": "San Diego"}
      ]
      Thank you.

      Comment


        #4
        The data being dates rather than strings is appropriate, and was our from-the-hip guess at what is going wrong.
        We have now run the test case and are not reproducing the problem. However we notice that you're reporting this on an old version of 9.1 (2014-08-24) -- try the latest 9.1 nightly build - it's likely you're seeing a long-resolved issue.

        Regards
        Isomorphic Software

        EDIT: Also - to prevent another turn-around... we did run the test against the latest 9.1 code and didn't see a problem. If the problem persists for you against the latest 9.1 nightly (and you've verified it really is loading - you can evaluate isc.version in the dev-console to be sure), please be sure to let us know the exact steps you took to reproduce the problem -- what values you entered into the date-chooser pop-up, etc.

        Comment

        Working...
        X