Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
155
igGrid with autoGenerateColumns: true Datetime format
posted

Hallo,

i use an igGird with autoGenerateColumns. How can I say that one column is a DataTime format? Now I have a date column, but this column have a string filter. I need a Datetime filter. 

Infragistics 16.1:

var source = {"ReportDatas":{"Data":[{"Name":"Test 1","Date":"17.08.2016","Menge":2.00}]}}

 $("#test").igGrid({
            autoGenerateColumns: true,
            width: "100%",
            height:'100%',
            dataSource: source,
            defaultColumnWidth : "200px",
            dataSourceType: "json",
            responseDataKey: "ReportDatas.Data",
            features: [
                {
                    name: "Paging",
                    type: "local",
                    pageSize: 50
                },
                {
                    name: "Sorting",
                    applySortedColumnCss : false,
                    type: "local"
                },
                {
                    name: "Filtering",
                    mode: "simple",
                    type: "local"
                },
                {
                    name: "Resizing",
                    deferredResizing: false,
                    handleThreshold: 40
                }
            ]
        });

Thank you

Parents
No Data
Reply
  • 1235
    posted

    Hello Vladimir,

    When the date column is auto-generated it is initialized as a string column. This issue can be solved by defining the column of type date:


     $("#test").igGrid({
        autoGenerateColumns: true,
        columns: [
            { headerText: "Date", key: "Date", dataType: "date", width: "200px" }
        ]
        ...
    }

    This column will replace the auto-generated one and will be recognized as a date-type column.

    Please feel free to contact me if you have further questions.

    Regards,
    Ivaylo Hubenov
    Entry-level developer

Children
No Data