EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: fatnjazzy on July 26, 2013, 05:23:33 AM



Title: Datagrid - Submit Filter (like loadFilter)
Post by: fatnjazzy on July 26, 2013, 05:23:33 AM
Hi.
I am trying to implement this product on an existing rest API.
I am using loadFilter in the datagrid to adjust the variable names coming from the server.

Code:
loadFilter : function(data) {
                var filtered = [];
                if (data.MaxResults) {
                    filtered.totalRows = data.MaxResults;
                    filtered.rows = data.Results;
                }
                return filtered;
            }

Can you tell me if there is something similar to loadFilter before the request is going out?
I use different variable names and I cant do anything(!) on the server side to adjust the names.

Thanks


Title: Re: Datagrid - Submit Filter (like loadFilter)
Post by: stworthy on July 26, 2013, 08:52:13 PM
The 'onBeforeLoad' event can also be used to intercept the request made to server. You can change the request parameters or cancel the loading action.


Title: Re: Datagrid - Submit Filter (like loadFilter)
Post by: fatnjazzy on July 27, 2013, 09:12:13 AM
Thanks.
Perfect.