jQuery UI Widgets › Forums › Editors › DateTimeInput › set "NULL" into jqxDateTimeInput
Tagged: Button, calendar, date, datetimeinput, jqxdatetimeinput, null, today, value
This topic contains 7 replies, has 4 voices, and was last updated by Kelvin 10 years, 11 months ago.
-
Author
-
HI
I have set NULL into DateTimeInput field, user should select data for search purpose, so intially field should be EMPTY.
When i set NULL, field appeas EMPTY, but user not able to select currect data for first time.
Step 1: Click on Calendar button then not able to select currect date, works for other dates.
Step2: Close field by clicking on Calendar button, but next time user can able to select currect date, but not forst date.$(“#draftOrderFromDate”).jqxDateTimeInput({ closeCalendarAfterSelection:true, width: ’90px’, height: ’20px’, theme: theme });
$(“#draftOrderToDate”).jqxDateTimeInput({ closeCalendarAfterSelection:true, width: ’90px’, height: ’20px’, theme: theme });$(‘#draftOrderFromDate’).jqxDateTimeInput({ value: null});
$(‘#draftOrderToDate’).jqxDateTimeInput({ value: null});$(‘#draftOrderFromDate’).on(‘valuechanged’, function (event) {
var jsDate = event.args.date;
$(“#draftOrderToDate”).jqxDateTimeInput(‘setMinDate’, jsDate);
});Thanks
Hello mallepaddi,
This issue does not occur in the latest version of jQWidgets (3.0.4). Here is the example we tested:
<!DOCTYPE html><html lang="en"><head> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.10.2.min.js"></script> <script type="text/javascript" src="../../scripts/demos.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdatetimeinput.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcalendar.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxtooltip.js"></script> <script type="text/javascript" src="../../jqwidgets/globalization/globalize.js"></script></head><body> <div id='content'> <script type="text/javascript"> $(document).ready(function () { $("#jqxWidget").jqxDateTimeInput({ width: '300px', height: '25px', closeCalendarAfterSelection: true }); $("#jqxWidget").jqxDateTimeInput({ value: null }); }); </script> <div id='jqxWidget'> </div> </div></body></html>
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi
below code doesn’t work and user not able to select current date for the first time, when we set date to null.
Draft Order No$(“#draftOrderNo”).jqxInput({ width: ‘200px’, height: ’20px’ , theme: theme});
$(“#draftOrderFromDate”).jqxDateTimeInput({ closeCalendarAfterSelection:true, width: ’90px’, height: ’20px’, theme: theme });
$(“#draftOrderToDate”).jqxDateTimeInput({ closeCalendarAfterSelection:true, width: ’90px’, height: ’20px’, theme: theme });$(‘#draftOrderFromDate’).jqxDateTimeInput({ value: null});
$(‘#draftOrderToDate’).jqxDateTimeInput({ value: null});$(‘#draftOrderFromDate’).on(‘valuechanged’, function (event) {
var jsDate = event.args.date;
$(“#draftOrderToDate”).jqxDateTimeInput(‘setMinDate’, jsDate);
});Thanks
Hi
In above case, date picker showing “current” date as “selected” (turned into grey color) and not allowing user to select the same again.
Thanks
Hi
Found culprit, because of i have set … .jqx-grid { border-width:0px;} , commenting this css works as expected.
Thanks
Hi,
I have a problem when using knockout binding with initial NULL value set on both datatimeinput control.
The second datetimeinput control allow me to select today’s date from the calendar control but the first datetimeinput control not allow me to select today’s date unless I click the calendar button and then come off it, then it will allow me to select today’s date.
Many thanks for your help.<!DOCTYPE html>
<html lang=”en”>
<head>
<link rel=”stylesheet” href=”../Controls/jqwidgets/styles/jqx.base.css” type=”text/css” />
<link rel=”stylesheet” href=”../Controls/jqwidgets/styles/jqx.bootstrap.css” type=”text/css” />
<script type=”text/javascript” src=”../Scripts/jquery-1.10.2.min.js”></script>
<script type=”text/javascript” src=”../Scripts/knockout-3.0.0.js”></script>
<script type=”text/javascript” src=”../Controls/jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”../Controls/jqwidgets/jqxdatetimeinput.js”></script>
<script type=”text/javascript” src=”../Controls/jqwidgets/jqxcalendar.js”></script>
<script type=”text/javascript” src=”../Controls/jqwidgets/jqxtooltip.js”></script>
<script type=”text/javascript” src=”../Controls/jqwidgets/jqxknockout.js”></script>
<script type=”text/javascript” src=”../Controls/jqwidgets/globalization/globalize.js”></script>
</head>
<body>
<div id=’content’><p>
first:
<div id=’d1′ data-bind=”jqxDateTimeInput: {value: dateOfBirthStart, width: ‘110px’, height: ’25’}”>
</div>
</p><p>
second:
<div id=’d2′ data-bind=”jqxDateTimeInput: {value: dateOfBirthEnd, width: ‘110px’, height: ’25’}”>
</div>
</p><script type=”text/javascript”>
$(document).ready(function () {
var myViewModel = function () {
var self = this;
self.dateOfBirthStart = ko.observable(null);
self.dateOfBirthEnd = ko.observable(null);
};var viewModel = new myViewModel();
ko.applyBindings(viewModel);
//$(“#jqxWidget”).jqxDateTimeInput({ width: ‘300px’, height: ’25px’, closeCalendarAfterSelection: true, theme: ‘bootstrap’ });
//$(“#jqxWidget”).jqxDateTimeInput({ value: null });//$(“#jqxWidget2”).jqxDateTimeInput({ width: ‘300px’, height: ’25px’, closeCalendarAfterSelection: true, theme: ‘bootstrap’ });
//$(“#jqxWidget2”).jqxDateTimeInput({ value: null });
});
</script>
</div>
</body>
</html>Hi Kelvin,
On my side, while testing with jQWidgets ver. 3.1.0, I can select the Today’s Date on both DateTimeInputs.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Thanks for your help.
I was using 3.0.4 and after changed to 3.1.0 everything work as expected.
-
AuthorPosts
You must be logged in to reply to this topic.