Telerik clientevents parameter / passing arguments to client events
In default methods you can’t able to pass argument to client event, but we can pass it through Function.prototype method.
Function.prototype.curry = function () {
var method = this, args = Array.prototype.slice.call(arguments);
return function () {
return method.apply(this,Array.prototype.slice.call(arguments).concat([args]));
};
};
Example
<script>
Function.prototype. argumentsvalue = function () {
var method = this, args = Array.prototype.slice.call(arguments);
return function () {
return method.apply(this, Array.prototype.slice.call(arguments).concat([args]));
};
};
function PostPondtimediff(sender, eventArgs,source)
{
alert(source); //source= 1=> (RadID1) 2=> (RadID2)
}
</script>
<telerik:RadTimePicker ID="RadID1" runat="server" DateInput-Enabled="false">
<ClientEvents OnDateSelected="changefunction.argumentsvalue(1)" />
</telerik:RadTimePicker>
<telerik:RadTimePicker ID="RadID2" runat="server" DateInput-Enabled="false">
<ClientEvents OnDateSelected="changefunction.argumentsvalue(2)" />
</telerik:RadTimePicker>
0 comments:
Post a Comment