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

  • Home
  • SEARCH
  • 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 6357645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:12:26+00:00 2026-05-24T23:12:26+00:00

My jqGrid is showing (1303153262000) on the initial grid load. However when the column

  • 0

My jqGrid is showing (1303153262000) on the initial grid load. However when the column is sorted the date is correctly formatted to (Aug 18 11:43 AM). Is there a way to get the grid to do this formatting automatically when it loads?

This is exactly what the date looks like as it is returned from the server (2011-04-18 19:01:02).

Here is the jqGrid column model i am using:

jQuery("#list4").jqGrid({
datatype: "local",
height: 250,
colNames:['Original ID','Date Created', 'Type', 'Title'],
colModel:[  
{name:'Id',index:'Id'},
{name:'cDate',index:'cDate', width:120, sorttype:'date', formatter:'date',     formatoptions: {srcformat:'M d h:i', newformat:'M d g:i A'}},  
{name:'xData',index:'xData', width:120}, 
{name:'zData',index:'zData', width:140}
],
rowNum: 1000,
multiselect: true,
toolbar: [true, "top"]
});

Any help would be greatly appreciated! Thanks.

Edit:

@Oleg here is what the data looks like on the server side:

2011-04-18 19:01:02
2011-04-18 19:01:28
2011-01-07 01:00:20
2011-04-18 19:01:02
2011-04-18 19:01:28
2011-01-07 01:00:20
2011-06-29 22:20:29
2011-06-29 21:47:55

And here is what it looks like when returned into the jqGrid:

Test: 1303153262000
Test: 1303153288000
Test: 1294362020000
Test: 1303153262000
Test: 1303153288000
Test: 1294362020000

Am i going to have to create a new array with the returned results with a function to change the epoch date to the date format i want? Having to do so would not make sense as jqGrid obviously has that functionality, but only when a user clicks sort. Is there a way to make jqGrid do this when the page loads?

I pulled this from eclipse. I am using a list/array called NotesArray. This is the array that is returned from the server:

NotesArray:{Original_Created_Date__c=2011-07-01 01:06:55, Title__c=Title of message 1 00001073: 06/30/2011 18:07:07, Type__c=Task, Id=a0D8000000Na0Q0EAJ, Originating_Id__c=00T8000001nuEzPEAU}
NotesArray:{Original_Created_Date__c=2011-06-30 22:14:48, Title__c=Title of message 2 00001072: 06/30/2011 15:15:00, Type__c=Task, Id=a0D8000000Na0Q1EAJ, Originating_Id__c=00T8000001nuCccEAE}
NotesArray:{Original_Created_Date__c=2011-06-30 21:24:47, Title__c=Title of message 3 00001071: 06/30/2011 14:25:00, Type__c=Task, Id=a0D8000000Na0Q2EAJ, Originating_Id__c=00T8000001nuB5cEAE}
NotesArray:{Original_Created_Date__c=2011-06-30 21:19:48, Title__c=Title of message 4 00001070: 06/30/2011 14:20:00, Type__c=Task, Id=a0D8000000Na0Q3EAJ, Originating_Id__c=00T8000001nuBFiEAM}
NotesArray:{Original_Created_Date__c=2011-06-30 21:14:47, Title__c=Title of message 5 00001069: 06/30/2011 14:15:00, Type__c=Task, Id=a0D8000000Na0Q4EAJ, Originating_Id__c=00T8000001nuAzDEAU}
NotesArray:{Original_Created_Date__c=2011-06-30 21:09:47, Title__c=Title of message 6 00001068: 06/30/2011 14:10:00, Type__c=Task, Id=a0D8000000Na0Q5EAJ, Originating_Id__c=00T8000001nuASSEA2}

Changed the return to JSON:

{"rows": [{"ObjectType": "Event","CreatedDate": "2011-01-03 09:16:51","ActivityType": "Call","OriginalId": "00U8000000Elxb4EAB","Title": "TEST EVENT"},{"ObjectType": "Event","CreatedDate": "2011-01-03 08:53:22","ActivityType": "Meeting","OriginalId": "00U8000000ElxY9EAJ","Title": "sadfasdf"},{"ObjectType": "Event","CreatedDate": "2011-01-03 08:51:04","ActivityType": "Meeting","OriginalId": "00U8000000ElxXkEAJ","Title": "werwrasdf"},{"ObjectType": "Task","CreatedDate": "2011-01-06 14:42:43","ActivityType": "Call","OriginalId": "00T8000001bce9VEAQ","Title": "test"},{"ObjectType": "Task","CreatedDate": "2011-01-03 08:50:41","ActivityType": "Meeting","OriginalId": "00T8000001aiqAXEAY","Title": "asdfasdfasf"},{"ObjectType": "Task","CreatedDate": "2011-01-03 08:50:29","ActivityType": "Call","OriginalId": "00T8000001aiqAcEAI","Title": "asdfsaf"},{"ObjectType": "Task","CreatedDate": "2011-01-03 08:52:55","ActivityType": "Call","OriginalId": "00T8000001aiqBuEAI","Title": "asdfsaf"},{"ObjectType": "Note","CreatedDate": "2011-08-22 15:17:11","ActivityType": "Note","OriginalId": "0028000000T03CUAAZ","Title": "Mondays Best"},{"ObjectType": "Note","CreatedDate": "2011-08-18 11:43:25","ActivityType": "Note","OriginalId": "0028000000SzwIjAAJ","Title": "Note Test"}]}
  • 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-24T23:12:26+00:00Added an answer on May 24, 2026 at 11:12 pm

    If the date come from the server as ‘2011-04-18 19:01:02’ why you use 'M d h:i' instead of 'Y-m-d H:i:s' as the value of srcformat?

    If the usage of

    formatoptions: {srcformat:'Y-m-d H:i:s', newformat:'M d g:i A'}
    

    will not solve your problem you should include the exact example of the input data which you use to fill the ‘cDate’ column.

    UPDATED: You can load the JSON data which you posted directly in the jqGrid. See the modified demo here. What you need is just to use in the jqGrid the names on columns like in the JSON data and additionally you should use

    loadonce: true,
    jsonReader: {
        repeatitems: false,
        id: "OriginalId",
        root: "rows",
        page: function (obj) { return 1; },
        total: function (obj) { return 1; },
        records: function (obj) { return obj.length; }
    }
    

    In the demo I added one more column because I don’t know whether ObjectType or ActivityType you want display in the 'Type' column. You can remove from jqGrid (not for JSON) any column which you not need to display. For example if the contain from the OriginalId column are not interesting for the user you can remove the corresponding column from the grid.

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

Sidebar

Related Questions

Is there an event in jqGrid when a user uses the column dialog to
var RowClick = function() { (#Grid).click( var s = $(#Grid).jqGrid('getGridParam', 'selarrrow').toString(); alert(s); $(#showgrid).load('/Inventory/Products/List/' +
In jqGrid, after a users chooses to remove a column(s), a grid's width becomes
This is almost continuation of a previous question. Problem showing jqgrid with dynamic column
jqgrid doc in here contains: method allow to reorder the grid columns using the
I have a jqgrid showing 117 total records in 50 rows per page (rowNum
I am using jqgrid 3.8. I have a grid which is having some editable
jqGrid edit and add forms render every field in separate row. If there are
I am using a custom formatter for a column in jqgrid. Code : function
jqgrid is showing an annoying horizontal scrollbar in the browser. I understand that it

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.