Welcome Guest, Not a member yet? Register   Sign In
pls help me with chain select with category and subcat in codeigniter
#1

[eluser]dhaulagiri[/eluser]
please help me how to create dropdown select menu in CI, where if i select category then sub categor will appear on the same page withour refreshing browser. Thanks
#2

[eluser]duellsy[/eluser]
Give this a read over, see if it helps

http://www.subooa.com.au/blog/developmen...th-jquery/
#3

[eluser]alexaaaaaaaaaa[/eluser]
i've done that with prototype if you are interested i can share my code m+c+v +database
#4

[eluser]masdevid[/eluser]
[quote author="duellsy" date="1298392051"]Give this a read over, see if it helps

http://www.subooa.com.au/blog/developmen...th-jquery/[/quote]

What about in codeigniter version? What if there are 3 level or more?
#5

[eluser]alexaaaaaaaaaa[/eluser]
[quote author="masdevid" date="1298422685"][quote author="duellsy" date="1298392051"]Give this a read over, see if it helps

http://www.subooa.com.au/blog/developmen...th-jquery/[/quote]

What about in codeigniter version? What if there are 3 level or more?[/quote]

The basic as i know it's to create a function somethin' like this
controller_name/3
where 3 it's the id and you'll get all the subcateg with the parent_id 3
egs. paris,roma,london has parent_id 3 in the country list you have France with the id 3
and so on then when you move to the jquery the things are simple i think
you wrap the options list into a div with and id and onchange you call a js function that will get the dom the content of the that div id.
As i told you i'm not very exp with jquery but i think if you take a look over the Json u'll understand it very well.
Here's a link with some screen casts http://www.weblee.co.uk/ the guy it's great you can learn jquery basis and codeigniter.
Regards,
Alex
#6

[eluser]masdevid[/eluser]
[quote author="alexaaaaaaaaaa" date="1298423772"][quote author="masdevid" date="1298422685"][quote author="duellsy" date="1298392051"]Give this a read over, see if it helps

http://www.subooa.com.au/blog/developmen...th-jquery/[/quote]

What about in codeigniter version? What if there are 3 level or more?[/quote]

The basic as i know it's to create a function somethin' like this
controller_name/3
where 3 it's the id and you'll get all the subcateg with the parent_id 3
egs. paris,roma,london has parent_id 3 in the country list you have France with the id 3
and so on then when you move to the jquery the things are simple i think
you wrap the options list into a div with and id and onchange you call a js function that will get the dom the content of the that div id.
As i told you i'm not very exp with jquery but i think if you take a look over the Json u'll understand it very well.
Here's a link with some screen casts http://www.weblee.co.uk/ the guy it's great you can learn jquery basis and codeigniter.
Regards,
Alex[/quote]


Thanks for reply, I already found it by myself before I read your reply. Little modification from this site http://www.subooa.com.au/blog/developmen...th-jquery/
Code:
jQuery('#level1').change(function(){
    $level1_chosen = jQuery('#level1 option:selected').val();
    if(jQuery('#level2_lists #level2_' + $level1_chosen).length == 0){
        $level1_chosen = 'empty';
    }
    jQuery('#level2').html(jQuery('#level2_lists #level2_' + $level1_chosen).html());
    jQuery ('#level2').change(function(){
        $level2_chosen = jQuery('#level2 option:selected').val();
        if(jQuery('#level3_lists #level3_' + $level2_chosen).length == 0){
            $level2_chosen = 'empty';
        }
        jQuery('#level3').html(jQuery('#level3_lists #level3_' + $level2_chosen).html());
    });
});
Thanks for the link too, I need some page to bookmarked.




Theme © iAndrew 2016 - Forum software by © MyBB