

[updated 24/11/2012] Dependent dropdown (library)
#81
Posted 13 December 2012 - 09:04 PM
#82
Posted 13 December 2012 - 09:07 PM
I'll have a time on the next week end. Can solve the problem.
Thank you!

____________________________________________________________
---!!!Please read these guidelines before asking to the forums!!!---
____________________________________________________________
David Oster aka George Pasparakis,
http://odphotography.com
http://eletter.gr
#83
Posted 14 December 2012 - 02:54 AM
code runs fine in save process, but an error in the editing process,
can you help me please ?
When did you download the latest version of grocery crud?
May be it your problem http://www.grocerycr...t__60#entry4441
This error is when I do an update on the grocery list
A Database Error Occurred
Error Number: 1146
Table 'grocerycrudzone_receive_stock' doesnt exist
Select * from ('zone_received_stock') where 'id'='2'
Filename: C:\xampp\htdocs\grocerycrud\system\database\DB_Driver.php
Line Number :: 330
#84
Posted 14 December 2012 - 03:05 AM
This error is when I do an update on the grocery list
A Database Error Occurred
Error Number: 1146
Table 'grocerycrudzone_receive_stock' doesnt exist
Select * from ('zone_received_stock') where 'id'='2'
Filename: C:\xampp\htdocs\grocerycrud\system\database\DB_Driver.php
Line Number :: 330
I've put the fix that I was wrong to main table
#85
Posted 16 December 2012 - 08:44 PM
#86
Posted 16 December 2012 - 09:27 PM
When I start an Add
I get the first dropdown for country Active, so that I can select it, and the other two deactivated. Ok, so I select France and for the regions that come now I get this
"NetworkError: 404 Not Found - http://localhost/realestate/Atributos_Copia/atributos_codigo/get_items/id_region/64"
where 64 is the number that corresponds to France.
where is my error Viktor because I have really the same scheme than in your example, Countries, Regions and Cities
thank you a lot
#87
Posted 16 December 2012 - 09:29 PM
#88
Posted 16 December 2012 - 09:30 PM
#89
Posted 16 December 2012 - 09:52 PM
show url to the controller and function
http://localhost/realestate/index.php/atributos_Copia/atributos_codigo
#90
Posted 16 December 2012 - 09:54 PM
and show your code please
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Atributos_Copia extends CI_Controller { function __construct() { parent::__construct(); $this->load->library('grocery_crud'); $this->load->library('image_moo'); $this->load->library('gc_dependent_select'); } public function index() { ; } public function atributos_codigo() { $crud = new grocery_CRUD(); $crud->set_subject('Atributos'); $crud->set_table('atributos'); $crud->where('Email', $this->session->userdata('username')); $crud->set_relation('id_objeto','object','object_name'); $crud->set_relation('id_seller','seller','seller_type'); $crud->set_relation('id_situation_s','situation','type_situation'); $crud->set_relation('id_transaction','transaction','transaction_type'); $crud->set_relation('id_pais', 'paises', 'nombre_pais'); $crud->set_relation('id_region', 'regiones', 'nombre_region'); $crud->set_relation('id_town', 'localidades', 'nombre_localidad'); $fields = array( // first field: 'id_pais' => array( // first dropdown name 'table_name' => 'paises', // table of country 'title' => 'nombre_pais', // country title 'relate' => null // the first dropdown hasn't a relation ), // second field 'id_region' => array( // second dropdown name 'table_name' => 'regiones', // table of state 'title' => 'nombre_region', // state title 'id_field' => 'id_region', // table of state: primary key 'relate' => 'id_pais', // table of state: id_pais es la foreign key de paises 'data-placeholder' => 'select state' //dropdown's data-placeholder: ), // third field. same settings 'id_town' => array( // third dropdown name 'table_name' => 'localidades', 'order_by'=>"nombre_localidad DESC", // string. It's an optional parameter. 'title' => 'nombre_localidad', // now you can use this format ))) 'id_field' => 'id_localidad', 'relate' => 'id_region', 'data-placeholder' => 'select city' ) ); $config = array( 'main_table' => 'atributos', 'main_table_primary' => 'id_atributo', "url" => base_url() . __CLASS__ . '/' . __FUNCTION__ . '/' ); $categories = new gc_dependent_select($crud, $fields, $config); // the second method: $js = $categories->get_js(); #+++++++++++++++ UPLOADING AND RESIZING PICS+++++++++++++++++ $crud->set_field_upload('thumb_a','assets/uploads/thumbs'); # $crud->set_field_upload('pic1','assets/uploads/pics'); # a $crud->callback_after_upload(array($this,'resize')); # $output = $crud->render(); $output->output.= $js; $this->_example_output($output); } #+++++++++++++++++++RESIZING PICS ++++++++++++++++++++++++++++++++++++++++++ function resize($uploader_response,$field_info, $files_to_upload) { $thumb_uploaded = $field_info->upload_path.'/'.$uploader_response[0]->name; $file_uploaded = $field_info->upload_path.'/'.$uploader_response[0]->name; $this->image_moo->load($thumb_uploaded)->resize(160,120)->save($thumb_uploaded,true); $this->image_moo->load($file_uploaded)->resize(600,400)->save($file_uploaded,true); if($this->image_moo->error) { print $this->image_moo->display_errors(); } return true; } #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ function _example_output($output = null) { $this->load->view('our_template.php',$output); } }
#91
Posted 16 December 2012 - 09:55 PM
"url" => base_url() .'index.php/'. __CLASS__ . '/' . __FUNCTION__ . '/'
#92
Posted 16 December 2012 - 10:01 PM
THANK YOU A MILLION TIMES
GOD BLESS YOU
YOU ARE A LEGEND!
Thank you for your great intelligence and thank you for helping us so much!!
#93
Posted 16 December 2012 - 10:03 PM


#94
Posted 18 December 2012 - 03:02 AM
when I use the native grocery crud CRUD process went smoothly with your library, but just integration with CI Bonfire, dropdown relation can not run smoothly, it endlessly looping
#95
Posted 18 December 2012 - 08:14 AM
#96
Posted 18 December 2012 - 08:17 AM
I think there is a javascript scripts conflict or "first_url" is invalid. What error do you have?
loops that do not stop when I have a dropdown category
#97
Posted 18 December 2012 - 08:18 AM
#98
Posted 18 December 2012 - 08:37 AM
Show your url to function and show your first_url form config
this is url to call function research
<a href="<?php echo site_url(SITE_AREA.'/content/kms/research')?>">
#99
Posted 18 December 2012 - 08:42 AM
#100
Posted 18 December 2012 - 08:43 AM
Also tagged with one or more of these keywords: Dependent dropdown, categories, ajax, dropdown, Categories and sub-categories
Support →
Grocery CRUD Enterprise →
Problem with the setRelation dropdown.Started by dhouwen, 04 Feb 2020 ![]() |
|
![]() |
||
Support →
I have a question →
CSRF Regenerate Not WorkingStarted by satheesh, 10 Dec 2019 ![]() |
|
![]() |
||
Support →
I have a question →
Grocery Crud dependent dropdownStarted by rim, 21 Nov 2019 ![]() |
|
![]() |
||
Development →
Extra coding / Plugins →
DependentDropdown(custom query) + PostAjaxCallbacks + MoreButtons + MoreUnsets + CustomColumnStarted by genya, 29 Jul 2019 ![]() |
|
![]() |
||
Support →
Grocery CRUD Enterprise →
Disable dropdown in search filters and change to text inputStarted by Indeax, 26 Nov 2018 ![]() |
|
![]() |
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users