more filter with date picker
I have create a additional filter to show on items listing page, then I want to add a date field with date picker , it seem like I need to load the js param 'add_edit' in order to do that ? but because items page need to load the 'items' js param, it there any way to load the datepicker in this case ?
Comments
http://www.getfuelcms.com/user_guide/modules/simple
I want to implement this datepicker http://jqueryui.com/datepicker/ in one of my admin view files
I have made following changes in fuel/application/views/_blocks/header.php file
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css" /> <script>
my view file is in fuel/modules/exporttocsv/views
<script> $(function() { $( "#txt_from" ).datepicker(); $( "#txt_date2" ).datepicker(); }); function validate() { var from =$("#txt_from").val(); var to =$("#txt_to").val(); if(!from || !to){ alert('Enter both FROM and TO date'); return false; } else { return true;} } </script> <style type="text/css"> </style> <div id="main_top_panel"> <h2 class="ico ico_blog_settings">Export to CSV </h2> </div> <div class="clear"></div> <div id="notification" class="notification"> <?=$notifications?> </div> <div id="main_content" class="noaction"> <div id="main_content_inner"> <div id="notification_extra" class="notification"> </div> <p class="instructions"> </p> <form action="exporttocsv/abc" method="post" id="frm_date"> From date:<input type="text" id="txt_from" name="txt_from" /><br/><br/> To date: <input type="text" id="txt_to" name="txt_to" /> <br/><br/> <input type="submit" value="Export to CSV" onclick="javascript:return validate();"> </div> </div>
I am not able to use jquery datepicker, can anybod help?
$config['fuel_javascript'][] = 'http://code.jquery.com/jquery-1.9.1.js'; $config['fuel_javascript'][] = 'http://code.jquery.com/ui/1.10.2/jquery-ui.js'; $config['xtra_css'] = 'http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css'; Also the 1.0 beta uses the jQuery UI datepicker and has those files already loaded: https://github.com/daylightstudio/FUEL-CMS/tree/1.0
I have included the code in MY_fuel.php file. and i was able to get the jquery datepicker. But i had issue with modules created using Base_module_model. It keeps refreshing. But wont load the list items in list view. I think it is because of the $config['fuel_javascript'][] added in my_fuel.php.
Is there a way to include the the datepicker related configurations in my controller file itself so that it wont effect other modules.
<?php require_once(FUEL_PATH.'/libraries/Fuel_base_controller.php'); class Exporttocsv extends Fuel_base_controller { public $view_location = 'generatecsv'; public $nav_selected = 'generatecsv/exporttocsv'; function __construct() { parent::__construct(); $this->config->module_load('generatecsv', 'generatecsv'); } function index() { $this->_render('exporttocsv_tpl', $vars); }
function index() { $vars['js'] = 'my_js_file.js'; $this->_render('exporttocsv_tpl', $vars); }
Also, are there any error messages in your browsers console when viewing the list_items page?
items wont appear in list view. It looks like it is keeps refreshing in list view.
i found this error
Uncaught TypeError: Object function ( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context, rootjQuery );
} has no method 'cookie' BaseFuelController.js:94
http://getfuelcms.com/forums/discussion/comment/1610/#Comment_1610