SetRowData change date format

QuestionsSetRowData change date format
Javier Albornoz asked 3 years ago

Hi, i have a problem to update a column with date formatter. That column is set:

$col[“formatter”] = “date”;
$col[“formatoptions”] = array(“srcformat”=>’Y-m-d’,”newformat”=>’d/m/Y’);

But when  i use :

var selr = jQuery(‘#lstAlumnos’).jqGrid(‘getGridParam’,’selrow’);

$(‘#lstAlumnos’).setRowData(selr, { ‘fechaegr’ : newfechaegr } ) ;

The column fechagr show data with the Y-m-d.

The var newfechaegr have format: d/m/Y.

Exists a way to set formatter dynamic or how i have a solution?

Best regards

Thanks!

2 Answers
Javier answered 3 years ago

I have a solution with:

$.jgrid.formatter.date.reformatAfterEdit = true;

$(‘#lstAlumnos’).setRowData(selr, { ‘fechaegr’ : newfechaegr } ) ;

Thanks

Abu Ghufran Staff answered 3 years ago

Thanks for updating.

It’s incorporated in latest build. May be you are using older version.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

5 + 8 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?