Welcome Guest, Not a member yet? Register   Sign In
Carbogrid - datagrid and CRUD
#21

[eluser]rw1[/eluser]
hello,

i have just come across carbogrid and loving the clear commented files and presentation, thanks!

i have followed instructions in readme.txt and uploaded files and made configuration changes, but when i browse to the 'Single grid' page it is not there, it seems because the 'sample' folder is not in the download file like the one on http://carbogrid.com/index.php/sample/home.

thanks!
#22

[eluser]rw1[/eluser]
update to above post:

i think this is the problem - the links in the downloadable zip file in application/views/header.php all point to a 'sample' folder and there is no 'sample' folder in the download. please someone help, i have posted and searched everywhere for a fix to this but can't find one yet. if i change the links to just point to the individual files in application/view ('grid_single.php' etc) then i get permissions and 404 errors Sad.

can someone please tell me how to get the downloadable package set up exactly the same as the one in the demo?

thanks!
#23

[eluser]dioslaska[/eluser]
@rw1: There is no sample folder in the download package, because sample is not a folder, it's the controller in application/controllers/sample.php. Links does not point to php files, they are routes to a controller's method. Are you familiar with Codeigniter and MVC? I just downloaded and tested the package and it works just fine. Maybe you can attach your config.php file and I can take a look at it.
#24

[eluser]rw1[/eluser]
hello,

thank you very much for your reply.

i have re-download and re-installed carbogrid and the problem i am getting now is different.

when i click on 'Single grid' or 'Multiple grid' it just loads the homepage again (even though the url looks like http://mysitename.com/subdirectory/sample/single and http://mysitename.com/subdirectory/sample/multiple resp.).

steps i followed per readme.txt instructions:

1. Edit application/config/config.php

- set your site URL here: $config['base_url'] = "http://mysitename.com/subdirectory/";

2. Import database

- create a new database (i already had a database)

- run database.sql ( i did not do this because i already had a database)

3. Setup database connection: (yes i did this)

- edit system/application/config/database.php:

$db['default']['hostname'] = "your_host";

$db['default']['username'] = "your_user";

$db['default']['password'] = "your_db_password";

$db['default']['database'] = "your_db_name";

4. To test file upload create files and files/temp folders and make sure that they are writeable (files is 755, and files/temp is 755)

5. Get rid of index.php from URL (apache mod_rewrite required)

- if application is not in your server root, edit last line in htaccess.txt: RewriteRule ^(.*)$ /path/to/app/index.php/$1 [L]

my htaccess at http://mysitename.com/subdirectory/.htaccess looks like:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /home/username/public_html/subdirectory/index.php/$1 [L]

- edit system/application/config/config.php: $config['index_page'] = "";

yes i did this.

- rename htaccess.txt to .htaccess

yes i did this.

please see attached config.php file. [edit: forum won't allow me to attach files).

thank you very much.

ps there also seems to be typos in the readme.txt file. there are incorrect references to:

system/application/config/database.php
system/application/config/config.php

the 'application' folder is not in the 'system' folder.
#25

[eluser]rw1[/eluser]
in the file error_log i can see:


PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20060613/uploadprogress.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20060613/uploadprogress.so: cannot open shared object file: No such file or directory in Unknown on line 0

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so: cannot open shared object file: No such file or directory in Unknown on line 0
#26

[eluser]dioslaska[/eluser]
It seems to me, that you have a .htaccess problem
First avoid 5. form the readme.txt, so remove the .htaccess file put back and $config[‘index_page’] = “index.php”

If that works, and you want to get rid of index.php from the URL change this line

RewriteRule ^(.*)$ /home/username/public_html/subdirectory/index.php/$1 [L]

to:

RewriteRule ^(.*)$ /subdirectory/index.php/$1 [L]


About the typos you're right. Prior to Codeigniter 2.0 the application folder was inside the system folder, I forgot to update the path.
#27

[eluser]dioslaska[/eluser]
@johnwbaxter:

You can maybe use the selected_ids parameter (I think it's not yet in the docs):

Code:
$selected_ids = array(2,5,18);

$params = array(
            'id' => 'users',
            'table' => 'user',
            'url' => 'sample/single',
            'uri_param' => $grid,
            'columns' => $columns,
            'commands' => $commands,
            'ajax' => TRUE,
            'selected_ids' => $selected_ids
        );

        $this->load->library('carbogrid', $params);

This way the grid renders the rows as selected.

But be aware that you have to implement the maintenance of the $selected_ids variable used above.
My idea would be, to catch the checkbox change event on client side with jQuery and do an ajax request which adds/removes the id from the $selected_ids array. And store the array in the session maybe.
#28

[eluser]rw1[/eluser]
[quote author="dioslaska" date="1348045446"]It seems to me, that you have a .htaccess problem
First avoid 5. form the readme.txt, so remove the .htaccess file put back and $config[‘index_page’] = “index.php”

If that works, and you want to get rid of index.php from the URL change this line

RewriteRule ^(.*)$ /home/username/public_html/subdirectory/index.php/$1 [L]

to:

RewriteRule ^(.*)$ /subdirectory/index.php/$1 [L]
[/quote]

steps i took:

1. rename .htaccess back to htaccess.txt
result - error message when clicking on 'Single grid':

"Not Found

The requested URL /subdirectory/sample/single was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."

2. change config.php contents to $config[‘index_page’] = “index.php”
result - error when clicking on 'Single grid':

A Database Error Occurred
Error Number: 1146

Table 'username_name.user' doesn't exist

SELECT COUNT(*) AS count, `user`.`id` FROM (`user`) LEFT JOIN `city` ON `user`.`id` = `city`.`id`

Filename: /home/username/public_html/subdirectory/models/carbo_model.php

Line Number: 254
#29

[eluser]dioslaska[/eluser]
[quote author="rw1" date="1348046535"]2. change config.php contents to $config[‘index_page’] = “index.php”
result - error when clicking on 'Single grid':

A Database Error Occurred
Error Number: 1146

Table 'username_name.user' doesn't exist

SELECT COUNT(*) AS count, `user`.`id` FROM (`user`) LEFT JOIN `city` ON `user`.`id` = `city`.`id`

Filename: /home/username/public_html/subdirectory/models/carbo_model.php

Line Number: 254[/quote]

At this point Carbogrid settings are ok.
But: the demo you downloaded is designed to work with the demo database, it cannot find out what do you want to do.
So please read the documentation and adapt the code in the sample to your specific needs.

#30

[eluser]rw1[/eluser]
which file needs to be changed in order to use your own database?

/public_html/subdirectory/application/controllers/sample.php ?

the 'documentation' page does not say which file the code being shown is from.

thank you.




Theme © iAndrew 2016 - Forum software by © MyBB