excuse me , i have a mistake in the previous post, i use cb field with Code type not use auto action. my field is execute when loaded in profile.i use some web service to other script (MOODLE) and it is return some data to user profile about some quiz result for user and it is out of my hand to edit that code. according your forge list ajax tab must release almost one month later. is it correct? i can wait for that to next month for that feature.krileon wrote: Recommend improving your code so it doesn't take forever to execute. Heavy database queries are usually a large reason for slow loading. Beyond that you can try using JS to make an ajax call to your auto action instead of acting on a specific trigger allowing it to be a separate process entirely.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
it use curl via php to call some webservice and then get the result and do some calculate with php operation on the result the echo that. can you say you mean about JS ? are you mean use Code field type?krileon wrote: If all your code field is doing is an HTTP call to Moodle to output whatever the response HTML is then you can replace that entirely with JS ajax call.
Please Log in or Create an account to join the conversation.
I don't know what all calculations you're doing or what the CURL call requires, but it's likely you can entirely replace it with JavaScript AJAX call. Either using jQuery or just plain JS via XMLHttpRequest.it use curl via php to call some webservice and then get the result and do some calculate with php operation on the result the echo that. can you say you mean about JS ?
A code field just outputs PHP, but that PHP can be used to echo a script element with all your needed JS or it can use the below API to utilizes jQuery or JS.are you mean use Code field type?
Template is used to customize the display of your code. I guess you could have a template that just has your necessary JS for performing the ajax call. That'd be entirely up to you, but it wouldn't be really any different than just putting that JS in the Code parameter.2-what is Template in the cb code field in Code tab before codebox? is it benefit for my use? can i use that to implement my curl and calculate on that and use code box only for implement JS with php echo syntax for ajax call to that template?
When using external web services you typically want to load their content in with ajax calls so they don't delay the load of your page. Doesn't really matter what platform you use as using ajax to load those services should always be the case. If you don't and you choose to use cURL then your server will wait until the response is done before it can render the page as that's just how PHP works. How you go about this is entirely up to you. It could be a backend Joomla module you display on Joomlas backend control panel for example.3- i have an important question about is it possible implement complete doshboard with cb. for example i want implement some chart about user grades with Fusioncharts or some other webservice or other query that maybe is heavy load on page. is CB suitable for this or is Joomla suitable for this? is it better to create separate component for this? (if need seperate topic for this subject say me to create new or move to new topic.)
Please Log in or Create an account to join the conversation.