jQuery UI Widgets Forums Grid Boolean filter (display "Yes" or "no")

This topic contains 3 replies, has 2 voices, and was last updated by  Peter Stoev 6 years, 11 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author

  • jquellier
    Member

    Hello,

    I discovered jqxGrid and I can apply filters but I can not get a proper filter on Boolean data.

    The filter displays the values ​​”equal,” not equal, …
    I want to display the filter with only “yes” or “no

    Here is part of my code if necessary:

    [...]
    var source =
    {
    datatype: "json",
    datafields: [
    //possible type : 'string', 'date', 'number', 'float', 'int' and 'bool'
    { name: 'id', type: 'int' },
    { name: 'ref', type: 'string' },
    { name: 'numMandat', type: 'string' },
    { name: 'adresse1', type: 'string' },
    { name: 'ville', type: 'string' },
    { name: 'cp', type: 'string' },
    { name: 'dep', type: 'string' },
    { name: 'type' },
    { name: 'transaction' },
    { name: 'nomProprietaire' },
    { name: 'nbPiece', type: 'int' },
    { name: 'surface', type: 'int' },
    { name: 'prix', type: 'float' },
    { name: 'presencePhoto', type: 'bool' },
    { name:'presenceWeb', type: 'bool' },
    { name: 'image', type: 'string' }
    ],
    id: 'id',
    url: url,
    root: 'data'
    };
    [...]
    columns: [
    { text: 'Photo', dataField: 'image', width: '106', cellsrenderer: cellsRendererImage },
    { text: 'Ref', dataField: 'ref', width: '60', cellsrenderer: cellsRendererLink },
    { text: 'N° Mandat', dataField: 'numMandat', width: '10%' },
    { text: 'Adresse', dataField: 'adresse1', width: '10%' },
    { text: 'Ville', dataField: 'ville', width: '10%' },
    { text: 'CP', dataField: 'cp', width: '5%' },
    { text: 'Dep', dataField: 'dep', width: '5%' },
    { text: 'Type', dataField: 'type', width: '40', minwidth: '40', cellsrenderer: cellsRendererType },
    { text: 'Transaction',filtertype: 'checkedlist', filteritems: ['Vente', 'Location'], dataField: 'transaction', width: '100', minwidth: '100', cellsrenderer: cellsRendererTransaction },
    { text: 'Propriétaire', dataField: 'nomProprietaire', width: '10%' },
    { text: 'Nb pièce', dataField: 'nbPiece', width: '5%' },
    { text: 'Surface', dataField: 'surface', width: '5%' },
    { text: 'Prix', dataField: 'prix', width: '5%', cellsalign: 'right', cellsformat: 'C0' },
    { text: 'Photo', dataField: 'presencePhoto', width: '5%', threestatecheckbox: true, columntype: 'checkbox' },
    { text: 'Online', dataField: 'presenceWeb', width: '5%', threestatecheckbox: true, columntype: 'checkbox' }
    ]

    Thank you very much for your help
    Regards


    Peter Stoev
    Keymaster

    Hi jquellier,

    For filtering of boolean values you have options to use the Filter Row as shown in our sample or through Context Menus as shown in the Filtering sample. In the Filter Row, to filter boolean data, just check the checkbox from the filter row. In the Filter’s Context Menu, you will have to type either true or false in the equal box.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    jquellier
    Member

    Thank you for your reply.
    However, it does not fully answer my question.

    I understand that this is currently not possible to have a checkbox for easy filter

    Regards


    Peter Stoev
    Keymaster

    Hi jquellier,

    There is a Checkbox for filtering boolean values in the Filter Row sample. You may take a look at it.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.