CodeIgniter and ExtJS issue


I am trying to pass entries drom db.table using json_encode() to am ExtJS grid:

$clienti = array();
        foreach ($query->result_array() as $row)
               $clienti[] = $row;
        echo json_encode(array('clienti' => $clienti));


Using firebug i get the fallowing error when loading the view:
http://localhost/softprofile/index.php/main?_dc=1254578827887 404 not found

My data store for the grid looks like this:
var dataStore = new{



          fields:['id', 'denumire', 'CUI', 'adresa']

I am new to codeigniter and extjs. What i am doing wrong.

Help me out please!

If firebug is telling you it can't find the page work on this first.....

The url in your datastore says 'main'.....put in a full url first just to find your page. Your json isn't written in an ext friendly way - we'll look at that once you get firebug to say you got to the page you are looking for.

When you get the error page back from a post with the _dc you'll usually need to you a dataproxy. Try changing your url first and see if you at least get a response back.

I'm assuming that the controller you are trying to get to and have data returned from already works as you plan....

I have enabled $config['enable_query_strings'] and used the data store like this:
var dataStore = new{



fields:['id', 'denumire', 'CUI', 'adresa'],


and i still get next error:
http://localhost/softprofile/index.php?c=main&m=main_model&_dc=1254744756560 404 not found

Can you get to the url from the address bar in the browser window? Or can you load the result of your controller function into a plain view first?

Make sure that you can find it using codeigniter first. If you can, then it's time to use a dataproxy with the datastore.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.