Domanda

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?

È stato utile?

Soluzione

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
            }
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top