knockout.js using datasource binding - how to format money and datetime data

1 posts, 0 answers
  1. #CaughtUp#
    #CaughtUp# avatar
    4 posts
    Member since:
    May 2010

    Posted 22 Jul 2012 Link to this post


    I am using MVC4 single page application on VS 2010 together with upshot.js and knockout.js.
    I am using the following MVVM javascript (as my view-model js):

    var dsCharges = upshot.RemoteDataSource({
    providerParameters: { url: constants.serviceUrlItem, operationName: "UpdateCharge" },
    provider: constants.provider,
            entityType: "Charge:#My.Models"
    ko.applyBindings(new ChargeViewModel(dsCharges));

    As you can see above, I am using a datasource binding to populate my grid. Data is displayed on my grid.
    I need help to format my data which are of type money and datetime.
    How do I format it using knockout.js? Can you please show me an example code snippet on how to do this?

    Many thanks,

Back to Top