I am using knockout and knockout mapping fromJS to map to my observablearray.

I'm calling a service method to return my json data to map to The db behind my service call has a column that is boolean true/false and right now that's the value that is pulling into my grid.

Is there a way to transform the value from true/false to something else like Active/Inactive

if So how?

有帮助吗?

解决方案

Nevermind. Found it. Simply need to set a values observableArray to my column defined in the grid.

VM JS file

self.statusValues = [{ value: true, text: 'Active' }, { value: false, text: 'Inactive' }];

In the view

values: statusValues
            }
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top