Multiple Select Box(Combo) change other's value on change of first select option.

edited November 2011 in Modules
Fuel is a Great cms. I am using it for my school management system.

I have created advanced module and everything was fine, I have to add ajax functionality to change the value of second combo with change of first combo.
like:- I need to select class from a select box and on other select box sections of this class should be loaded.

I added StudentsController.js on assets/js loaded through
'js' => array('education' => 'StudentsController.js')
but on this line
var path = jqx.config.fuelPath + '/education/students/classes_combo/' + classId + '/' + id;
firebug says::--
POST http://osms.kml/fuel/education/students/classes_combo/24/1
404 Not Found
I have added modules under education folder. It looks like:
image

I can't figure out what is happening.
my education_routes.php is:

Comments

  • edited 2:33AM
    I think in your case, you don't want those routes to point to the default "module" controller found in the FUEL folder, but instead, have them point to the controllers in your education module correct?
  • edited November 2011
    My controller students.php looks like this

    <?php
    require_once(EDUCATION_PATH.'/libraries/Education_base_controller.php');

    class Students extends Education_base_controller {

    function __construct()
    {
    parent::__construct();
    }


    function classes_combo($class_id = NULL, $id=NULL)
    {
    if (is_ajax() AND !empty($classs_id))
    {
    $this->load->library('form');
    ......
    }
    }

    }
  • edited 2:33AM
    Right... but the routes you have above, point to the default module at FUEL_FOLDER.'/module'. Try changing those routes to point to:
    <?php $education_controllers = array('education', 'staffs', 'faculties', 'classes', 'sections', 'students', 'parents', 'fees', 'users', 'settings'); foreach($education_controllers as $c) { $route[FUEL_ROUTE.'education/'.$c] = EDUCATION_FOLDER.'/'.$c; $route[FUEL_ROUTE.'education/'.$c.'/(.*)'] = EDUCATION_FOLDER.'/'.$c.'/$1'; } // included in the $education_controllers array //$route[FUEL_ROUTE.'education/settings'] = EDUCATION_FOLDER.'/settings';
  • edited November 2011
    I did this but it gives an error:
    The configuration file development/students.php and students.php do not exist.
    on page:
    http://osms.kml/fuel/education/students/
    and 404 not found error on
    http://osms.kml/fuel/education/
    May be the problem is something else.
    Can you please have a look on my module which can be found here.
    http://www.rama.com.np/education.rar
  • edited 2:33AM
    It appears that your libraries/Education_base_controller.php file is trying to load helpers and configs that don't exist for your module.
  • edited November 2011
    Ya I realize that and finally I found out a solution.
    I added ajax_combo method on model and defined path by
    var path = jqx.config.fuelPath + '/education/students/ajax/combo/';
    on myController.js
    Thank you for your time.
    FUEL cms is great.
Sign In or Register to comment.