Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
igGrid with knockout
posted

Hello 

I wonder if it is possible to use KO extend as a formatter for the grid. For example in a pure KO table I use: ko.observable($data.Price).extend({money: $data.Currency }) when the result is usually something like $1.00 or €2,00 or else.

I wonder if the current formatter: function(val) {return 'something';} can handle the KO extend functionality.

Thanks

Herald

Parents
  • 5513
    Verified Answer
    Offline posted

    Hello Herald,

    You may be able to use KO extenders as a way to format a value that's shown in the grid, however, it will depend on what you are trying to do. In your example an otherwise numeric value will be turned by the extender to a string containing the currency symbol. As the grid binds to the modified value its data source will use the value as a string for sorting, filtering, editing, etc. purposes. The grid formatter on the other hand is purely visual and doesn't affect the value stored in the data source.

    If you are able to provide me with your requirements, I can try to create a small sample demonstrating a possible approach in accomplishing them.

    Thank you for using Infragistics forums!

    Best regards,

    Stamen Stoychev

Reply Children
No Data