Monday 15 August 2011

javascript - Knockoutjs customBinding text base on language -


In all my models I have at least 2 inspeable properties that I use for language (display on it Base)

  this.id = data.id; This.DataNameEn = ko.protectedObservable (cuberryItem.DataNameEn); // This PROP D ends with this.DataValue = ko.protectedObservable (cuberryItem; // ends with this prop.nataNameDe = ko.protectedObservable (cuberryItem.DataNameDe); value of data);   

I need to create a custom when 'en' will be displayed from some global variable example when compulsive DataNameEn when another language is again DataNameDe First, I tried to do it with the calculation but it does not have the right to do this for every villa. I can store it with binding or it is better to leave it with the calculation.

THX

I will go with the computational notice if you do not have all your You can do this for the models so you can use the heritage, and want to make a class designated like local and then all your ViewModels will inherit from this class.

Here is an article using heritage using jquery, however, if you have javascript javascript knowledge then you should do better without jquery.

No comments:

Post a Comment