Hi
Can anyone tell me how to set up a date picker as a filter for a CC5 connection? Or point me in the right direction? I can think that I could write some code to form a date from some drop-downs and filter on some derived matching field but a date picker would be easier.
Any suggestion would be appreciated.
Regards
Nick
Can anyone tell me how to set up a date picker as a filter for a CC5 connection? Or point me in the right direction? I can think that I could write some code to form a date from some drop-downs and filter on some derived matching field but a date picker would be easier.
Any suggestion would be appreciated.
Regards
Nick
Hi,
I tried to put code in header to load the same calendar of chronoform. It should run but I don't know the problem. The following code I used:
while the field date is the following:
Can anyone help me?
I tried to put code in header to load the same calendar of chronoform. It should run but I don't know the problem. The following code I used:
<?php
JHtml::_('jquery.framework');
JHtml::_('bootstrap.framework');
$doc =& JFactory::getDocument();
$doc->addScript(JURI::base().'libraries/cegcore/assets/gplugins/gdatetimepicker/gdatetimepicker.js');
$doc->addStylesheet(JURI::base().'libraries/cegcore/assets/gplugins/gdatetimepicker/gdatetimepicker.css');
$script ="
jQuery(document).ready(function(jQ) {
jQ('#dataFrom').gdatetimepicker();
jQ('#dataTo').gdatetimepicker();
jQ(\":input\").on(\"select_date.gdatetimepicker\"', function(){
if($(this).data('on_date_selected')){
var on_date_selected = $(this).data('on_date_selected');
if(on_date_selected in window){
window[on_date_selected](jQ(this));
}
}
});
});
";
$doc->addScriptDeclaration($script);
?>
while the field date is the following:
<input type="text" id="dataFrom" name="dataFrom" data-gdatetimepicker-format="d-m-Y" placeholder="" size="9" class="validate['required'] form-control A" title="" style="display:inline;" data-load-state="" data-tooltip="" type="text" data-fieldtype="gdatetimepicker" data-start_view="d" />
Can anyone help me?
Please try the following code, and make sure you have the latest update:
<?php
$document = \GCore\Libs\Document::getInstance();
$document->_('jquery');
$document->_('gdatetimepicker');
$document->addJsCode('jQuery(document).ready(function($){
$("#field_id").gdatetimepicker();
});');
Hi
Can you clarify that for me please? Does Max's code replace all of cenzomita's code (except the <input line of course)? I have tried that without success. If you would be willing to post the final complete section I would appreciate that.
Thanks and regards
Nick
Can you clarify that for me please? Does Max's code replace all of cenzomita's code (except the <input line of course)? I have tried that without success. If you would be willing to post the final complete section I would appreciate that.
Thanks and regards
Nick
Hi Nick,
Yes, my code should work and you would only need an input with the id = "field_id" as defined in the code!
Regards,
Max
Yes, my code should work and you would only need an input with the id = "field_id" as defined in the code!
Regards,
Max
This topic is locked and no more replies can be posted.