Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3787036
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:46:39+00:00 2026-05-19T11:46:39+00:00

I have an ASP.NET MVC 3 page. On it, I have a table which

  • 0

I have an ASP.NET MVC 3 page. On it, I have a table which I turn into a jqGrid using JSON data from an ajax call. The grid has the following setup:

myGrid = $('#myGrid');
myGrid.jqGrid({
    caption: 'My Grid',
    datatype: 'local',
    data: data.rows,
    height: 250,
    pager: '#myPager',
    viewrecords: true,
    colModel: [
        ...,
        {
            label: 'blah',
            name: 'blah',
            align: 'left',
            sortable: true,
            editable: false,
            width: 85,
            formatter: 'date',
            sorttype: 'date',
            datefmt: 'm/d/Y',
            formatoptions: { srcformat: 'm/d/Y', newformat: 'm/d/Y' }
        },
        ...
    ]
});

// turn on filter toolbar
myGrid.filterToolbar();

data.rows is returned from the ajax call. This works in all ways except one. I can paginate client-side, sort client side, and search by every field except the one I show the colModel for. This ‘blah’ field is a date field, and it displays the dates correctly, in mm/dd/yyyy format. However, when I type in something like 11/17/2010 into the toolbar and press enter, the search returns 0 records.

So I dug deep into the jqGrid code, and here’s what it generates before it searches:

{"groupOp":"AND","rules":[{"field":"blah","op":"bw","data":"11/17/2010"}]}

Eventually, when it goes through every row and it evaluates the operation on the field, the eval(m) && p.push(this) line, m is this:

(String(this.blah).substr(0,10) == String("11/17/2010"))

Basically, it looks to me like it’s not recognizing that the field is a date. It calls parse instead of parseDate. Anybody have any ideas how to fix this? I know searching server side is easy, I can just pass that string, parse it, and bam. But I’d like to stay client side if I can. I was able to duplicate this in some of the samples that Oleg and Tom put up, so it’s either an issue or I’m missing something in the configuration…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T11:46:40+00:00Added an answer on May 19, 2026 at 11:46 am

    I find your question interesting so +1 from me to your question. Because you posted the line

    (String(this.blah).substr(0,10) == String("11/17/2010"))
    

    used in eval during the local searching I suppose you spend much time to understand how the local searching are implemented. Because you see that the line above (see (String(this.blah).substr(0,10) ...) is not what should be done (the value of String(this.blah) will be “2010-11-17” instead of “11/17/2010”), you can overwrite the corresponding function of jqGrid (the function _getStr inside of $.jgrid.from) and fix the problem in the way.

    Some time ago I spend much time to prepare the corresponding the demo, which demonstrates this technique. The demo was prepared as the answer in trirand forum. In the question one wanted to find strings like 'bénevise' in case of searching for 'benevise'. So one have to implement really custom local searching. I hope that the information will be enough for you to fix the problem which you describe.

    UPDATED: It seems to me that I have found a much more simple workaround. You should just define searchoptions: {sopt: ['eq','ne']} for the 'blah' column having the data. Then "bw" (begin with) will not used for the column. The “equal to” and “not equal to” operations work correctly in the local searching.

    UPDATED 2: Here is the working example where I use sopt option.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table of results in an ASP.Net MVC page where the last
I have a ASP.NET MVC page, which call WCF logic. The system is single-signon
I have an ASP.Net MVC Ajax.BeginForm that submits and updates my page properly when
I have an ASP.Net MVC view which inherits from a ViewModel. The ViewModel contains
I have HTML table on the ASP.NET MVC View page. Now I have to
I'm trying to create a page using ASP.NET MVC 2 which shows two things:
I have an ASP.NET MVC page with multiple file uploads. After a failed post,
I have an ASP.NET MVC Page with a button called Start Live Meeting. When
I have a ASP.NET MVC page. I Configured a IIS Website and added the
I have two instances of an Address.ascx control in an ASP.NET MVC page. <h1>Shipping

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.