Sunday 15 February 2015

javascript - jqGrid date sort (local) doesn't work -


I know that there are lots of answers to such issues, but they all have some unique situations. In my case however, this should be a very simple thing because I am not doing anything strange with dates, even then I can not get the date of work done.

Here is the data that I receive from Jason, partially re-edited, because it is a company project).

  {"Lines": [{"Cell": ["140 9 35", ..., "19/06/2013 3:17: 02 PM", ... ]}, {"Cell": ["140894", ..., "19/06/2013 10:01:57 am", ...]}, {"cell": ["140803", .. ., "18/06/2013 11:50:01 am", ...]}, {"cell": ["140008", ..., "10/06/2013 12: 44: 44 pm", ...]}, {"cell": ["138280", ..., "28/05/2013 11:57:19 am", ...]}, {"cell": ["118286", ..., "15/11/2012 7:13:19 pm", ...]}]}   

So as you can see, when I first solved it The problem I get from the server is that when I use the sort in the table, it gets worse Land and are the dates June date 28.05.2013 put "later". Here is the screenshot May

And Here is the jqGrid code I used to generate it (I have partially re-edited it for a brief but I do not think I have deleted anything affecting this problem).

I set the column names and column models as the first variable to put things in. CNAME available = ['id', _company, _location, ... _createdon ..], cmodel = [{name: 'ticketId', index: 'ticketId', key: true , Width: 60, align: 'center', type-type: 'integer', fixed: true, resizable: incorrect, editorial: {edithidden: true}}, {name: 'company', index: ' Company ', width: 117, edit: {edithidden: true}}, {name:' location ', index:' location ', width: 94, editrules: {edithidden: true}}, ... {name: CreatedOn ', index:' CreatedOn ', width: 85, type type:' date ', dated:' m / d / y h: i: s', fixed: true, editrals: {adidas: true Date, true}}, ...]

then the date format m / d / yh: i: s A from date data received from the server

I load jqGrid like this

  ticketsTable = tableWrap.jqGrid ({ Url: UrlTicketHandler + filtersData, MTYPE, 'method = GetTickets & amp;': 'received', datatype: 'json', colNames: CNAME available, colModel: cmodel, height: 'auto', ROWNUM: 1000, autowidth: True, sort name: 'sort of order', 'pgbuttons: false, pginput: false, pgtext:', viewrecords: true altRows: true, loadonce: true, scrollOffset: 0, hidegrid: false, caption : _tickets, top Pager: true, pager: '#ticketsList_footer', prmNames: {Page: Null, Rows: Null, Search: Null}, viewsortcols: [true, 'vertical', true], recordtext: _showingxt + '{2}' + _tickets, gridview: true, ignoreCase: true, multicolored: full access, load full: function (d) {if (firstload) {firstload = false; If (isColState & amp; myColumnsState.permutation.length) {$ (this) .jqGrid ("remapColumns", myColumnsState.permutation, true); }} SaveColumnState.call ($ (this), this.p.remapColumns); }});   

There is only one thing that I think is that the issue of any issue can be the column saving part (I did not include the entire function here, but I'm not sure it Really relevant and I took it from JqGrid's own site)

I left some formatting on the other columns but I do not touch the date column.

Am I missing anything here?

I was trying to figure out what was happening at the time. Naturally, it was not until after Murphy's law that I did not post it on Stackworflow, in the end I had made a lot of mistake in writing my original format, written format. Of course now it is coming out in public, on the difference, as always, to see my shame. There is nothing left to say sigh

No comments:

Post a Comment