jQWidgets Forums

jQuery UI Widgets Forums Editors DateTimeInput Is it possible for it to be null?

This topic contains 14 replies, has 5 voices, and was last updated by  jqWizard 12 years, 11 months ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
  • Is it possible for it to be null? #2194

    martyphee
    Member

    I have it bound to a model field and it’s null. I’d like to show blank on the screen. Is it possible?

    Is it possible for it to be null? #2196

    Peter Stoev
    Keymaster

    Hi martyphee,

    Null values are currently not supported. We will implement this feature for the next release.

    If you want to show the DateTimeInput blank, you can use this code:

    $("#jqxWidget").jqxDateTimeInput('dateTimeInput').val('');

    Best Regards,
    Peter Stoev

    http://www.jqwidgets.com
    jQWidgets Team

    Is it possible for it to be null? #2228

    Peter Stoev
    Keymaster

    Hi martyphee,

    In jQWidgets 1.7, we implemented the Null Values support in the jqxDateTimeInput widget. In order to set the value to null, you can use the code below:

    $("#jqxWidget").jqxDateTimeInput('setDate', null);

    Best Regards,
    Peter Stoev

    http://www.jqwidgets.com
    jQWidgets Team

    Is it possible for it to be null? #3797

    ajesicus
    Member

    Hi, I still got the same problem on version 2.0. I cannot call ‘setDate’ and set the value to ‘null’

    Is it possible for it to be null? #3799

    Peter Stoev
    Keymaster

    Hi ajesicus,

    You should set the date to null, not ‘null’.

    i.e

    $("#jqxWidget").jqxDateTimeInput('setDate', null);

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Is it possible for it to be null? #3800

    ajesicus
    Member

    yeah, that’s is what i did and what an error say is ‘C is null’ in jqxdatetimeinput.js

    Is it possible for it to be null? #3801

    Peter Stoev
    Keymaster

    I am unable to reproduce it.

    This is my test code and it works as expected:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="../../scripts/gettheme.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/jquery.global.js"></script>
    </head>
    <body>
    <div id='content'>
    <script type="text/javascript">
    $(document).ready(function () {
    var theme = getTheme();
    // Create a jqxDateTimeInput
    $("#jqxWidget").jqxDateTimeInput({ width: '250px', height: '25px', theme: theme });
    $("#jqxWidget").jqxDateTimeInput('setDate', null);
    });
    </script>
    <div id='jqxWidget'>
    </div>
    </div>
    </body>
    </html>

    Could you post here a sample code which reproduces this issue?

    Looking forward to your reply.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Is it possible for it to be null? #3826

    ajesicus
    Member

    Ok, i’ve tried with the plain text html as you did, It’s work fine. But when i put this html template into my javascript, it’s error. This may be my code issue.

    i’ll try to figure it out.

    Thank you. Your JQx save my time. ;=)

    Is it possible for it to be null? #4425

    jqWizard
    Participant

    When I delete (using key backspace or del) value in jqxDateTimeInput widget it resets to min value. Is it possible to delete so the widget has no value(null or ”)?

    Is it possible for it to be null? #4443

    Peter Stoev
    Keymaster

    It is not possible to set null value or “” with keyboard combination.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Is it possible for it to be null? #4454

    jqWizard
    Participant

    Any estimates when will it be possible?

    Is it possible for it to be null? #4480

    thinhvu
    Member

    Hi,
    Why I set null value to jqxDateTimeInput widget with setDate method, and after that it return current date when I use getDate method?

    Is it possible for it to be null? #4481

    Peter Stoev
    Keymaster

    Hi thinhvu,

    It is more correctly the returned value to be null. Thank you about that. There’s an ‘if’ statement inside the ‘getDate’ method which checks whether the value is undefined and returns new Date if it is. We’ll consider changing this behavior in the future updates.

    Best Wishes,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Is it possible for it to be null? #4482

    Peter Stoev
    Keymaster

    Regarding the question when it will be possible to set Null date with keyboard combination:

    This functionality will be implemented in the upcoming build of jQWidgets. Users will be able to set null Date by pressing ctrl+del, ctrl+backspace keyboard combinations. Pressing only Del or Backspace will result in the same behavior as now – reset the edited date part to its minimum value.

    Best Wishes,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Is it possible for it to be null? #5331

    jqWizard
    Participant

    I would recommend the opposite approach. Using ctrl+del and ctrl+backspace keyboard combinations to reset the edited date part to its minimum value and using keys del and backspace to set null Date. I think most users would expect such behaviour.

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.