Created
December 30, 2016 08:38
-
-
Save andybala2020/b590c3bcf69f5d398dbc289c296aa6fb to your computer and use it in GitHub Desktop.
KendoUI Survey For Rollbase Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function callback(arr) { | |
for (var k=0; k<arr.length; k++) { | |
alert("===>" + arr[k]); | |
}} | |
var viewModel = kendo.observable({ | |
name: "", | |
designation: "", | |
company: "", | |
telephone: "", | |
workEmail: "", | |
eventAttended: null, | |
primaryBusiness: "", | |
customerIndustry: [], | |
role: [], | |
priorities: [], | |
initiatives: [], | |
surveySubmitted: false, | |
interests: [], | |
contactTime:null, | |
partnerInterest: null, | |
submit: function (e) { | |
e.preventDefault(); | |
var validator = $("#frmSurvey").kendoValidator().data("kendoValidator"); | |
if (validator.validate()) { | |
console.log(this) | |
var x = new Array(); | |
x["FullName_Survey"] = this.get("name"); | |
x["Work_Email_XSurvey2"] = this.get("workEmail"); | |
x["Company_Name"] = this.get("company"); | |
x["Attend_Event"] = this.get("eventAttended"); | |
x["Contact_Timeframe"] = this.get("contactTime"); | |
x["Customer_Industry"] = this.get("customerIndustry").join(); | |
x["Designation_XSurvey2"] = this.get("designation"); | |
x["Initiatives_Focus"] = this.get("initiatives").join(); | |
x["key_Priorities_"] = this.get("priorities").join(); | |
x["Nature_of_Business"] = this.get("primaryBusiness"); | |
x["Progress_Partnership"] = this.get("partnerInterest"); | |
x["Progress_Solutions"] = this.get("interests").join(); | |
x["Role"] = this.get("role").join(); | |
x["Work_Phone_No_X"] = this.get("telephone") | |
rbf_createRecord("SurveyXQuestions", x , false, callback); | |
var callback2 = function(errMsg, apiName) { | |
alert("ERROR: "+errMsg+" in: "+apiName); | |
}; | |
rbf_setErrorsCallback(callback2); | |
this.set("surveySubmitted", true); | |
} | |
} | |
}) | |
kendo.bind(document.body, viewModel) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment