⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

callback_add_field with relation field - the proper html?



xxaxxo
  • profile picture
  • Member

Posted 05 April 2012 - 14:24 PM

Hello again,
i'm trying to customize my relation fields so that they display different things within the dropdown and the multiselect field, but the problem that i have is, when i return this html:


<select name='plan_id' id='' class='chosen-select' data-placeholder='Select Plan' style='width:300px'>
<option value=''></option><option value='1' >Plan 1</option><option value='2' >Plan 2</option>
</select>


instead of getting the fancy dropdown that i normally get with relation field - i get a simple dropdown, can you give me the proper html for the dropdown , or what am i missing

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 05 April 2012 - 16:27 PM

Add this:


$crud->set_css('assets/grocery_crud/css/jquery_plugins/chosen/chosen.css');
$crud->set_js('assets/grocery_crud/js/jquery_plugins/jquery.chosen.min.js');
$crud->set_js('assets/grocery_crud/js/jquery_plugins/ajax-chosen.js');
$crud->set_js('assets/grocery_crud/js/jquery_plugins/config/jquery.chosen.config.js');


and probably it will work.

xxaxxo
  • profile picture
  • Member

Posted 06 April 2012 - 06:11 AM

10x the problem was that i am using the crud with combination of twitter bootstrap and html5boilerplate , so one of their js's nulled all the other ones....