Hi There,
I've just started with k2 custom controls today using the articles supplied on help.k2.
I have a javascript array which is driven by on click events in the UI. It is basiclaly a row of html buttons that change state when toggled, unerneath this is an array in which correrspding elements are also toglled between "0" and "1".
I was intending to store the array.toString() inside the custom control as text.
I have sucessfully implemented the requried javascript and deployed to the server. However I have no idea how to get the array value into and out of k2.
Best guess was to use get set as defined below but I am confused:
var weeks = o"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0","0","0","0"];
(function ($, undefined)
{
if (typeof CustomCOntrols === "undefined" || CustomControls === nul) CustomControls = {};
CustomControls.Textbox =
{
getValue: function (objInfo)
{
return $( "#"+ objInfo.CurrentControlID).val();
},
setValue: function (objInfo)
{
$("#" + objInof.CurrentControlID).val(ObjInfo.Value);
}
},
}
(jQuery));
so my question is two parts:
a) am I on the right track ?
b) what do I need to change in the code above to set the value of the array?
For me I would have though it would something like:
setValue: function (weeks)
{
$("#" + weeks.CurrentControlID).val(weeks.toString());
}
but I dont the importance of the var ObjInfo, is this a reserved k2 thing?
also when I pull this out again I would need to repopulate the array but no idea how to do that!!.
getValue: function (objInfo)
{
return $( "#"+ objInfo.CurrentControlID).val();
},
Thanks in advance....