Hi,
I just started to work on this platform last week.
I have created a table and want to add data to it on submit button click.My table name is Doctor. The data is not syncing to table i guess.This is my code .Api key is not mentioned for obvious reason.Also whenever I logout all the changes made in code disappears.I am really new to this platform so please help me out.
app.formView = kendo.observable({
onShow: function() {},
afterShow: function() {}
});
// START_CUSTOM_CODE_formView
// Add custom code here. For more information about custom code, see http://docs.telerik.com/platform/screenbuilder/troubleshooting/how-to-keep-custom-code-changes
// END_CUSTOM_CODE_formView
(function(parent) {
var apiKey="";
var el = new Everlive(apiKey);
var doc=new kendo.data.DataSource({
type: "everlive",
transport: {
typeName: "Doctor"
}
});
var formViewModel = kendo.observable({
fields: {
city: '',
state: '',
address2: '',
address1: '',
},
submit: function() {
var add1=$("#add1").val();
var state=$("#state").val();
var city =$("#city").val();
if(add1=="")
{
$("#adderr").show();
return false;
}
if(state==null){
$("#stateerr").show();
return false;
}
if(city==""){
$("#cityerr").show();
return false;
}
doc.add({
Address1:formViewModel.fields.address1,
City:formViewModel.fields.city,
State:formViewModel.fields.state
});
doc.one("sync",this.close);
doc.sync();
alert("hello");
},
cancel: function() {}
});
parent.set('formViewModel', formViewModel);
})(app.formView);
Thanks,
Rugved