$(document).ready(function () {
var activeControlsViewModel = kendo.observable({
assetProperties:[
{property: "prop1"},
{property: "prop2"},
{property: "prop3"}],
controlName: "Control Name",
controlType: "Control Type",
controlFunction: "Control Function",
addControl: function () {
this.get("controls").push({
name: this.get("controlName"),
markup: (this.get("controlType")),
label: (this.get("label")),
cntrlFunction: (this.get("controlFunction")),
dataBind: (this.get("dataBind")),
dataTextField: (this.get("dataTextField"))
});
},
deleteControl: function (e) {
// the current data item (product) is passed as the "data" field of the event argument
var control = e.data;
var controls = this.get("controls");
var index = controls.indexOf(control);
// remove the control by using the splice method
controls.splice(index, 1);
},
controls: []
});
var controlBankViewModel = kendo.observable({
addControl: function () {
var controlSelector = $("#controlSelector").data("kendoDropDownList");
controlSelection = controlSelector.select();
console.log("controlSelection: "+controlSelection)
activeControlsViewModel.controls.push({
name: this.controls[controlSelection].name,
markup: this.controls[controlSelection].markup,
label: this.controls[controlSelection].label,
cntrlFunction: this.controls[controlSelection].cntrlFunction,
dataRole: this.controls[controlSelection].dataRole,
dataBind:...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.