Welcome Guest, Not a member yet? Register   Sign In
Ci+Ajax (mootools) i cant . just i cant,
#1

[eluser]Peter74[/eluser]
Hi, all
2 days trying to do this work, ( please check this the page )

iam trying to update the calendar in his div "cajaAjax" id (id, when i press the lefts o rights arrows , this arrows have the "ajaxlink" id

Front.php Controller
Code:
class Front extends Controller {
    function Front()
    {
        parent::Controller();    
    }
    function index()
    {
        $this->load->view('front_view');
    }
    function cal(){
       $data['ano'] = $this->uri->segment(3);
       $data['mes'] = $this->uri->segment(4);
       $this->load->view('front_view',$data);
    }
}

Part of the Front View is the calendar div, is a separated file called from the from_view.php

cal_mes_view.php

Code:
<?php
    if(!isset($mes)) $mes = '';
    if(!isset($ano)) $ano = '';    
   $myCal = new Calendar($ano,$mes);                  
?>
<div style="margin-left:7px; margin-bottom:10px">
&lt;?php  echo $myCal->create();?&gt;
</div>

ajax_call.js
Code:
window.addEvent('domready', function() {
    if (!window.demo_path) window.demo_path = '';
    var demo_path = 'http://localhost/kine/index.php/front/cal';
    var req = new Request.HTML({url:demo_path,
        onSuccess: function(html) {
            $('cajaAjax').set('text', 'dd');
            $('cajaAjax').adopt(html);
        },
        onFailure: function() {
            $('cajaAjax').set('text', 'fallo la caga.');
        }
    });
    $('ajaxlink').addEvent('click', function() {
        req.send();
    });
});

I hope, somebody can helpme, if is more information required, i upload quicky
Txs Very Much In Advance
Peter




Theme © iAndrew 2016 - Forum software by © MyBB