jQWidgets Forums

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Filter grid date range Filter grid date range #17362

    jnegro1176
    Member

    Thanks Peter. I’ve switched to the filterrow method and I’m able to filter by date. The only thing I can’t figure out is how to filter by a start and end date, only by exact date. Here’s some of my code. Any input would be greatly appreciated.

    var source = {
    datatype: ‘json’,
    datafields: [
    { name: ‘id’, type: ‘number’},
    { name: ‘creator’, type: ‘string’},
    { name: ‘status’, type: ‘string’},
    { name: ‘subject’, type: ‘string’},
    { name: ‘created’, type: ‘date’},
    { name: ‘assigned_to’, type: ‘string’},
    { name: ‘edit’},
    ],
    url: ‘{{ apiurl }}’,
    id: ‘id’,
    }

    var dataAdapter = new $.jqx.dataAdapter(source, {
    downloadComplete: function (data, status, xhr) { },
    loadComplete: function (data) { },
    loadError: function (xhr, status, error) { }
    });

    $(“#TableContainer”).jqxGrid(
    {
    sortable: true,
    filterable: true,
    showfilterrow: true,
    width: tableWidth,
    pageable: true,
    pagesize: defaultRows,
    pagesizeoptions: [’15’,’25’,’50’],
    autoheight: true,
    source: dataAdapter,
    columnsresize: true,
    columns: [
    { text: ‘ID’, datafield: ‘id’, width: 50 },
    { text: ‘Creator’, datafield: ‘creator’, width: ((tableWidth * .2)-20), filtertype: ‘checkedlist’, filteritems: userList },
    { text: ‘Status’, datafield: ‘status’, width: ((tableWidth * .2)-20), filtertype: ‘checkedlist’, filteritems: statusList },
    { text: ‘Subject’, datafield: ‘subject’, width: ((tableWidth * .2)-20) },
    { text: ‘Created’, datafield: ‘created’, width: ((tableWidth * .2)-20), filtertype: ‘date’, cellsformat: ‘yyyy-MM-dd hh:mm tt’ },
    { text: ‘Assigned To’, datafield: ‘assigned_to’, width: ((tableWidth * .2)-20), filtertype: ‘checkedlist’, filteritems: userList },
    { text: ”, datafield: ‘edit’, width: 50 },
    ],
    });

Viewing 1 post (of 1 total)