I am new to Knockout, and I have the following question:
I have Ids coming from database and each Id has its corresponding Description (this is actualy enum in .NET, but I do not think this is important in this question).
For example,
a) for variable "PType
": 0 - Undefined; 1 - Low Structure; 2 - Hight Structure
b) for variable "ClientType
": 0 - Undefined, 1 - P Type; 2 - S Type
etc. for some other variables also
How to properly define model for this dependency? Currently I have only Ids like
PType: ko.observable();
ClientType: ko.observable();
and I show Ids on page:
<span data-bind="text: PType"></span>
<span data-bind="text: ClientType"></span>
However, I need to have something like: PTypeDescription
and ClientTypeDescription
to show for User. I believe that those are somehow dependant variables, but cannot get it working.