WelcomeForumsCommunityHow to filter datagrid data dynamically

Wijmo Team Member
rex posted on June 7, 2012 at 9:12 am link

if i wanna use a textbox as text filter, once the user keypressed, the datasource will filter the data and shown on datagrid, how can i do that? thanks

Wijmo Team Member
sergeys posted on June 9, 2012 at 1:48 am link

This is only possible if an external editor of filter values is used (text box):

        $(‘#demo’).wijgrid({
                columns: [
                        { filterOperator: 'Contains' }
                ],
                data: [['a'], ['b'], ['c']],
                ready: false,
                loading: function (e) {
                        $(e.target).wijgrid(‘option’, ‘ready’, false);
                },
                loaded: function (e) {
                        $(e.target).wijgrid(‘option’, ‘ready’, true);
                }
        });

        $(‘#textBox’).keyup(function (e, args) {
                var grid = $(‘#demo’).data(‘wijgrid’);

                if (grid.options.ready) {
                        grid.columns()[0].option(‘filterValue’, $(e.target).val());
                }
        });
Answer

This topic has 2 voices, contains 1 reply, and was last updated by  sergeys 350 days ago.

You must be logged in to reply to this topic.