PDA

View Full Version : [CLOSED] gridfilter / submitted data / json deserialize different values



tMp
Oct 09, 2013, 3:23 PM
Hi

In a gridpanel with an ajaxproxy (.ashx) I am working with gridfilters. Unfortunately I can't use a direct method so I get the filter values in the context.request object as json strings. Sometimes the look like this

"[{\"type\":\"boolean\",\"value\":\"true\",\"field\":\"C\"}]"
and sometimes like this

"[{\"type\":\"list\",\"value\":[\"a\"],\"field\":\"b\"}]"
depending if it was a listfilter or a booleanfilter, etc. Is there a possiblility to deserialize easly into the filtercondidtions or a simple dictionary? The first one is easy but the second one has "[]" in it so I get an error... I will never use an array there but the listfilter submits the data like this anyway.

Thank you for some tips or any help.

Daniil
Oct 09, 2013, 4:39 PM
Hi @tMp,

Seems the only thing you should do is:

FilterConditions fc = new FilterConditions(s);
where "s" is a JSON filter string which you get from a request.

So, does it not work for you?

tMp
Oct 09, 2013, 6:43 PM
@Daniil.

Oh, mea culpa. That works perfectly. I thought that was only for the direct method!

thank you very much.