Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- If the options of dropdown are static, then you can connect onchange event of parent dropdown and reload the values of second dropdown using jquery.
- $col["name"] = "firstcolumn";
- ...
- $col["editoptions"]["onchange"] = "function(){ update_second(); }"
- $col["name"] = "secondcolumn";
- ...
- and in JS code
- <script>
- function update_second()
- {
- if ($('#firstcolumn').val() == 1)
- {
- $('#secondcolumn').html('');
- $('#secondcolumn').append('<option value="cat-a">Cat A</option>');
- $('#secondcolumn').append('<option value="cat-b">Cat B</option>');
- $('#secondcolumn').append('<option value="cat-c">Cat C</option>');
- }
- else if ($('#firstcolumn').val() == 2)
- {
- $('#secondcolumn').html('');
- $('#secondcolumn').append('<option value="cat-a">Cat A</option>');
- $('#secondcolumn').append('<option value="cat-b">Cat B</option>');
- }
- }
- </script>
Add Comment
Please, Sign In to add comment