jQWidgets Forums

jQuery UI Widgets Forums Grid Add a row with string date

This topic contains 4 replies, has 2 voices, and was last updated by  cosostones 10 years, 1 month ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Add a row with string date #69073

    cosostones
    Participant

    Hello,

    I would like to add a row in the grid through the addrow method. In my data I received a date in a string in ISO format (e.g. “1988-05-23T00:00:00.000”) and I can’t change it.

    In my grid my datafield has the type property set to ‘date’ and the column has a the cellsformat property set to “dd-MMMM-yyyy”.

    When a use the addrow method the format seems not to be applied.

    I create a jsfiddle to show you : http://jsfiddle.net/gtgva8v1/1/.

    Is that a bug or is there a different way to applied the format ?

    Regards.

    Add a row with string date #69076

    Peter Stoev
    Keymaster

    Hi cosostones,

    jqxGrid works with JavaScript date objects. This means that when you call addrow, make sure your Date is JavaScript Date object.

    Best Regards,
    Peter Stoev

    Add a row with string date #69079

    cosostones
    Participant

    I understand but why the grid do the trick when the data directly come from the server and not when using the addrow method ?

    Add a row with string date #69080

    Peter Stoev
    Keymaster

    Hi cosostones,

    It’s one thing to Data Bind the widget and another to add something dynamically. I wrote you what should be done and I suggest you to follow my advice if you want working solution.

    Best Regards,
    Peter Stoev

    Add a row with string date #69083

    cosostones
    Participant

    Ok thanks for your answer I’ll try to do it.

    Regards.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.