wj-flex-grid - Sort and display page

Posted by: charles.nguyen-viet on 4 February 2019, 7:03 am EST

  • Posted 4 February 2019, 7:03 am EST


    I'm using this flexgrid

    <wj-flex-grid control="vm.flexGrid"
    <wj-flex-grid-column width="43">
    <wj-flex-grid-cell-template cell-type="Cell">
    <input type="checkbox" />
    <wj-flex-grid-column ng-repeat="key in vm.columnBindings"
    header="{{key.replace('_',' ')}}"

    <wj-flex-grid-cell-template ng-if="key==='launch'" cell-type="Cell" width="45">
    <a target="_blank" ng-if="$item.launch" href="{{$item.launch}}">
    <!-- Temporary - set the applicant to Head, TODO: set the applicant in the controller; TBD to have options for other applicants -->
    <div style="width: 24px; height: 24px">
    <svg version="1.1" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
    <path fill="#005885" d="M-0.001,0v100H100V0H-0.001z M68.328,33.793H54.502v40.18h-9v-40.18H31.748v-7.775h36.58V33.793z"></path>

    I have a big list and a column name "date". How do I sort the list by "date" descendant and display the sorted list?

  • Marked as Answer

    Replied 4 February 2019, 4:33 pm EST


    Please make sure that the Date is parsed to Date Object before binding it to the FlexGrid.

    var dt= "2017-09-25T00:00:00.000Z";
    var dDate= new Date(dt);

    Also, please set the date format so that it can be sorted correctly

    <wj-flex-grid-column [binding]="'date'" [format]="'MM/dd/yyyy'"></wj-flex-grid-column>

    Please let me know in case you still face issues.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels