How can I send OptionsServer to Server correctly ? Cause I'm trying to send values from checked Checkbox to server.
My code:
var viewModel = {};
viewModel.ui = {};
viewModel.ui.FlashbackReport = {
ChoosenEmails : ko.observableArray(),
ChoosenOptions : ko.observableArray(),
OptionsServer : ko.observableArray(),
Options : ko.observableArray([ "New Contacts", "Updated Contacts","Verified Contacts" ]),
OptionsToSend: ko.computed({
read : function () {
var viewModelShortcut= viewModel.ui.FlashbackReport;
if (viewModelShortcut.ChoosenOptions()=="New Contacts")
viewModelShortcut.OptionsServer.push('NEW');
else if (viewModelShortcut.ChoosenOptions()=="Updated Contacts")
viewModelShortcut.OptionsServer.push('BETTER');
else if (viewModelShortcut.ChoosenOptions()=="Verified Contacts")
viewModelShortcut.OptionsServer.push('NOT_BETTER');
/* else if (viewModelShortcut.ChoosenOptions()[0]=="New Contacts"
&& viewModelShortcut.ChoosenOptions()[1]=="Updated Contacts"
&& viewModelShortcut.ChoosenOptions()[2]=="Verified Contacts")
viewModelShortcut.OptionsServer.push('NEW','BETTER','NOT_BETTER');
*/
},
deferEvaluation: true
}),