Skip to main content

Hi,


how is it possible to define a control method for a custom control? Same concept as for the new PDF-Control --> Save as PDF.


My goal is to call a JavaScript method from any rule.


Is there any documentation out there?


Thanks


Tim

Hi,


Take a look at this link: 

 

http://help.k2.com/onlinehelp/K2smartforms/DevRef/1.0.7/default.htm#Adding_Custom_Javascript.html%3FTocPath%3DCustom%20Controls%7C_____3

 

It details how you can add custom javascript to an existing control. 


Your link doesn't help.

The question is how to add a method which can be triggered by rules. Not how to include Javascript!

Any Idea? Anyone?

 

Edit: So here's what I found out so far...

 

Xml:

 

  <ExecuteMethod>ToolbarControl.execute</ExecuteMethod>
<Methods>
<Method ResultType="None">
<Name>ResolvePermissions</Name>
<DisplayName>Resolve Permissions</DisplayName>
<Description>Yadda</Description>
</Method>
</Methods>

JS:

 

 

ToolbarControl = {

>...]

execute: function (objInfo) {
var parameters = objInfo.methodParameters;
var method = objInfo.methodName;
var result = "";
var currentControlID = objInfo.CurrentControlID;

switch (method) {
case "ResolvePermissions":
// some code here
break;
}
}
};
})(jQuery);

 

But still missing is how to trigger a method implemented at the server control (code behind)...

 

Edit:

 

Found it ;)

http://help.k2.com/onlinehelp/k2smartforms/devref/1.0.7/default.htm#adding_and_using_an_ajax_handler.html 


Reply