Skip to main content

In K2 Smarftom how Intialize or Initialized works is - It will load and rendered form on the client side then starts calling rules inside Initialize or Intialized.

 

Currently, we have lot of rules in Initiaze or Initialized to fill drop downs and hide/show controls based on the data fetched from database. So the form and views are getting rendered on the broswer first then it starts calling the rules in Initialize/Initialized one by one using AJAX calls. It is causing lot of delay in loading complete form, different load circles keep spinning for each drop down or showing/hiding controls after it rendered.

 

Is there any way to have ASP.Net Page_Load like event in K2 Smartforms where you can define rules which will be executed on K2 server before form is getting loaded/rendered on client side.

Hi sanjay_patil01



Nope, there isn’t a way to have a rule configured in way that it can fires before the form initialises, coz that’s the first rule of all rules.



Many rules on a single form makes it to run slow or too slow, I can suggest that while configuring your rules try to lessen them as you configure them. The less the rules on the form, the faster it will run.


 


Best Regards,
Abraham.


As above, there's no way to do anything before the form initialize rule.


 


A suggestion if you haven't done so already, switch the execution of the loading actions in the rule to run async as far as possible, unless they depend on one another for it's data to load.


 


Otherwise redesign the form and make use of tabs to split the form up and have the controls in the other tabs load its data only when the tabs are selected, this should speed up the initial form load time.


Reply