Welcome Guest, Not a member yet? Register   Sign In
CI URI Problems and Using Extjs Grid
#1

[eluser]Fielder[/eluser]
For anyone that is familiar with Extjs (grid) and Codeigniter.

When I am calling a link
Code:
&lt;?= anchor('extjs/multistore_list/'.$row['con_id'],'<img id="button_edit" src="../../assets/images/icons/table.png" />'); ?&gt;

the link is directing me into my extjs controller and multistore_list function, where I can then run all the logic I need to generate scripts and outputs using the Extjs grid. But I need to pass the con_id parameter into my controller so I can fetch the appropriate contract id.

But the link is giving me an error in firebug when clicked
Code:
http://fieldraid/rtui/codeigniter/index.php/index.php/reports/listMultistores/1/?_dc=1249015745818&xaction=load
A 404 Page Not Found. Why is this kicking out this error, and what work-arounds might there be?

Here is my controller
Code:
&lt;?php

class Extjs extends Controller
{
    function Extjs()
    {
        parent::Controller();        
        
        $this->load->library('RTUI_App');
        $this->load->library('session');

        $this->load->model('Stores', 'store');
    }
    
    function index()
    {
        
    }
    
    function _render_view($script, $var = NULL)
    {
        $data['content_header_id'] = "gridsheet";
        $data['content_header_title'] = "Store Grid Sheet";
        $data['title'] = "RTUI Grid Sheet - View";
        $data['session_employee_name'] = $this->rtui_app->get_loggedIn_user($this->session->userdata('employee_id'));
        
        $data['ext_js'] = $script;
        $data['ext_id'] = $var;
        
        $this->load->view('include/header', $data);
        $this->load->view('extjs/main-grid');
        $this->load->view('include/footer');
    }
    
    function store_list()
    {
        $this->_render_view($this->uri->segment(2));
    }
    
    function multistore_list()
    {
        $this->_render_view($this->uri->segment(2), $this->uri->segment(3));
    }
}

If you know Extjs, you'll see that I then load up the script containing the Extjs grid code and populate it to a specified element's ID.
#2

[eluser]oldroy[/eluser]
Fielder,
I was able to solve the same problem by using a data proxy so extjs doesn't send the extra crap on the post.

<code>
var dataProxy = new Ext.data.HttpProxy({
url: base_url + "index.php/admin/images/ajaxGetImages",
method: 'POST'
});

ds = new Ext.data.GroupingStore({
proxy: dataProxy,
reader: readme,
sortInfo: {field: 'aspect', direction: "ASC"},
groupField: 'aspect'
});
</code>




Theme © iAndrew 2016 - Forum software by © MyBB