Cm-ajax how can I access the data send by Tygh::$app['ajax']->assign('success_rate', json_encode($success_rate));

I created a link something linke this

<a href="{$url}" id="submit-form-ajax" class="cm-ajax" data-ca-target-id="main_div_ajax"></a>

From the controller I sent this

Tygh::$app['view']->assign('data', $data);

    if (defined('AJAX_REQUEST')) {
        Tygh::$app['ajax']->assign('success_rate', json_encode($success_rate));
    }

The $data variable is getting assigned perfectly in main_div_ajax, but I want to access that data sent through Tygh::$app[‘ajax’] to reload the chart but not able to access the data from there…

Please suggest what to do, what is the right approch for it?

So what URL do you use? And how do you process parameters from this request?

You can add the js hook

$.ceEvent('on', 'ce.ajaxdone', function(elms, inline_scripts, params, data, text){
 /*** CHECK IF THIS IS THE AJAX REQUEST YOU USE AND ADD THE DESIRED ACTION ***/
});
1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.