Hi Guys
I'm sure this is just a syntax issue.. but I'm stuffed if I can work it out.
If I set my messages ( for testing only) like this in the editor template it works fine.
<div data-container-For=
"recurrenceRule"
Class=
"k-edit-field"
>
<div data-bind=
"value:recurrenceRule"
name=
"recurrenceRule"
data-role=
"recurrenceeditor"
data-frequencies=
"['never','daily','weekly']"
data-messages=
"{'frequencies':{'never':'Nie','daily':'Täglich','weekly':'Wöchentlich','monthly':'Monatlich','yearly':'Jährlich'}}"
></div>
</div>
But if I try to set the data-messages to a javascript variable I can't get it to work. ( I wan't to do this as I want to be able to change the language based on the browser language.. so I want to have an externally defined message object.)
I've tried all sorts of ways to define the variable.. but it never works
var
rmessages = {
'frequencies'
:{
'never'
:
'Nie'
,
'daily'
:
'Täglich'
,
'weekly'
:
'Wöchentlich'
,
'monthly'
:
'Monatlich'
,
'yearly'
:
'Jährlich'
}};
// var rmessages = {frequencies:{never:"Nie",daily:"Täglich",weekly:"Wöchentlich",monthly:"Monatlich",yearly:"Jährlich"}};
//-------------------------------
<div data-container-For=
"recurrenceRule"
Class=
"k-edit-field"
>
<div data-bind=
"value:recurrenceRule"
name=
"recurrenceRule"
data-role=
"recurrenceeditor"
data-frequencies=
"['never','daily','weekly']"
data-messages=
"rmessages"
></div>
</div>
When I run , it seems that the data-messages are set to 'rmessages' ( as per the attached image) however is other parts of the same template I refer to javascript variable and this works. ( e.g setting the 'data-source' for this drop down which is on the same template.
<div id=
"selectsg"
style=
"display:none;"
>
<div Class=
"k-edit-label"
><label
for
=
"SGIDId"
>Queue</label></div>
<div data-container-For=
"SGID"
Class=
"k-edit-field"
>
<input name=
"SGIDId"
type=
"text"
id=
"SGIDId"
data-role=
"combobox"
data-source=
"sgdataSource"
data-text-field=
"name"
data-value-field=
"id"
data-bind=
"value:SGID"
data-placeholder=
"Select Queue..."
data-value-primitive=
"true"
/>
</div>
</div>
Can someone please point out my stupid error in syntax or thinking!
Many thanks
Rob
asdad