jQuery UI Widgets Forums Grid filter row search as "equal" instead of "contains"

This topic contains 3 replies, has 2 voices, and was last updated by  Dimitar 12 years, 2 months ago.

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

  • userdch
    Participant

    Team –
    i have the filter row enabled. if i type “A” it returns rows having both “A” and “BAB”.
    i want it to return only “A”.

    in other words, search defaults to “contains” type. i want “equals” type.
    i can achieve this through the toolbar method, but i am interested in achieving it through the filter row as its more simple.


    Dimitar
    Participant

    Hello userdch,

    If we take the Filter Row as an example, you just have to change the filtercondition of the Name column from ‘starts_with’ to ‘equal’:

                    columns: [
    { text: 'Name', columntype: 'textbox', filtertype: 'textbox', filtercondition: 'equal', datafield: 'name', width: 115 },
    {
    text: 'Product', filtertype: 'checkedlist', datafield: 'productname', width: 220
    },
    { text: 'Available', datafield: 'available', columntype: 'checkbox', filtertype: 'bool', width: 67 },
    { text: 'Ship Date', datafield: 'date', filtertype: 'date', width: 210, cellsalign: 'right', cellsformat: 'd' },
    { text: 'Qty.', datafield: 'quantity', filtertype: 'number', cellsalign: 'right' }
    ]

    Best Regards,
    Dimitar

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


    userdch
    Participant

    thank you very much. this really helped.
    by default, a filter text box shows up on top of all columns.
    is there a way to selectively place filter text box only on some columns ?
    there is a “showfiltermenuitems” option but the documentation is not clear what exactly it does.


    Dimitar
    Participant

    Hi userdch,

    To remove the filter text box only on some colums, set the column property filterable to false, i.e.:

                      { text: 'Name', columntype: 'textbox', filterable: false, datafield: 'name', width: 115 },

    Best Regards,
    Dimitar

    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.