This question is locked. New answers and comments are not allowed.
Hey Folks,
So, I figured out my javascript parsing of wildcards, and I noticed something a little odd. I rolled my project back to the stock filtering and noticed something very odd. I can use ajax filtering to do startswith , contains, but endswith never works. It always returns 0 records.
This is using the standard filter control on the MVC Grid, and without any scripts or etc
I also tested my Repository/Model and I can use the .EndsWith from linq and get the correct results. not sure whats up.
Its probably something extremely silly, but I cant figure it out for the life of me.
My Model looks like this:
| [GridAction] |
| public ActionResult _AjaxBinding() |
| { |
| var items = inventory.GetItems(); |
| return View(new GridModel(items)); |
| } |
| public IQueryable<InventoryItem> GetItems() |
| { |
| //TODO: Make this into a view |
| var items = (from i in dataContext.tblItems where i.EffectiveEndDate > DateTime.Now |
| select new InventoryItem { |
| Description = i.ItemDescription, |
| ID = i.ItemInternalID.ToString(), |
| PartNumber = i.ItemBarcodeID, |
| TotalQuantity = GetTotalQuantityByPartNumber(i.ItemBarcodeID) |
| }); |
| return items; |
| } |
| My controller: |
I get 0 records returned when I attempt to do "endswith" if i use contains or startswith, everything is great.
I cant for the life of me figure out why
Update: Turned off AJAX binding, everything works but "Ends With" filtering. :\ Not sure whats going on or why this would be the case. I'm using the 2010.1.309 scripts folder if that makes a difference.