문제

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