EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: 2plus2 on April 17, 2013, 07:54:54 PM



Title: Need second set of eyes on DataGrid Reload...
Post by: 2plus2 on April 17, 2013, 07:54:54 PM
We have a combobox as a "filter" for the datagrid, and the load/reload is not picking up the new query parameters we are trying to pass over to filter the grid:

        $('#dgFilter1').combobox({
            panelHeight: 'auto',
            selectOnNavigation: false,
            valueField: 'value',
            textField: 'label',
            data: [{ label: 'Active (All)', value: '*', selected: true }, { label: 'Active (Yes)', value: '1' }, { label: 'Active (No)', value: '0'}],
            filter: function (q, row) {
                return row.label.toLowerCase().indexOf(q.toLowerCase()) == 0;
            },
            onSelect: function (combo) {
               // Data Grid load/reload code goes here
            }
        });

We've tried the following and no matter what we do it uses the original url provided when the data grid was built via HTML:

               $('#dg').datagrid('load', {
                    a:'getFullList',
                    f:combo.value
                });
or
               $('#dg').datagrid('load', {
                    url: '/admin/ajaxCurrencies.aspx?a=getFullListf=' + f:combo.value
                });
or
               $('#dg').datagrid('load', {
                    queryParams: {
                         a:'getFullList',
                         f:combo.value
                    }
                });

What am I doing wrong?



Title: Re: Need second set of eyes on DataGrid Reload...
Post by: 2plus2 on April 17, 2013, 10:02:32 PM
Ok...This is what I got working:

            onSelect: function (combo) {
                $('#dg').edatagrid({
                    url: '/admin/ajaxCurrencies.aspx?a=getFullList&f=' + combo.value
                });
                $('#dg').edatagrid('load');
            }

If someone can explain, why my other options didn't work, I would appreciate it.