Search Questions

Dec 12, 2011 at 9:07 PM

I hope to sometime soon have time to dive into this solution and start answering some of my own questions.  Meanwhile, I do have 2 questions.

First, JqGridRequest.SeachingFilters is read-only.  We are looking for a way to pre-populate this criteria, depending on some other user input.  Is there some other way of accomplishing?  I didn't see an Add method exposed on the List.

Second, I have a model property defined as follows.  However, it appears that setting "DateValidation = true" is not working.  Is this feature incomplete or am I missing something?

Thanks in advance. Karl.

 

// I've included this constant declaration for completeness
private const JqGridSearchOperators SearchDataOperators = JqGridSearchOperators.Eq | JqGridSearchOperators.Ne |
                JqGridSearchOperators.Lt | JqGridSearchOperators.Le |
                JqGridSearchOperators.Gt | JqGridSearchOperators.Ge;

// ...

[DisplayName("Birth Date")]
[JqGridColumnEditable(false)]
[JqGridColumnSearchable(true, DataInit = "$.DatePicker", DateValidation = true, SearchOperators = SearchDataOperators)]
[JqGridColumnSortable(true)]
[JqGridColumnLayout(Alignment = JqGridAlignments.Center, Width = 90, Resizable = false)]
public string DateOfBirth { get; set; }

Coordinator
Dec 13, 2011 at 8:38 AM

Hi,

I'm not sure I have understood correctly your first question, but JqGridRequest.SeachingFilters is a standard property which takes JqGridRequestSearchingFilters object. This object has two collections on it (Filters and Groups) which both are standard List<T> (there is an Add method on those).

In case of second question, the date validation should work properly. I will check this later today, but please can you give me an example of value which is not date and it passes through the validation?

Regards,
Tomasz Pęczek

Dec 13, 2011 at 1:58 PM

My bad, there is nothing for you to look into.  In the first question, I just didn't read the docs very well.  In the second question, I don't believe it's working properly, but also believe the issue is in jqGrid itself; Lib.Web.Mvc is writing the correct searchrules value. 

Thanks for your response.
Karl.