Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
datepicker in grid (2 issues)
posted

First issue is a display issue.  The two date selectors are just showing the drop down without an input and looks pretty awful, image below. Once you select a date you can't tell the selected date until you click done closing the editor.

Second, and far more critical to me, I can't figure out how to alter options of the editor in an event of the editor.  I want the second date to have a minimum date of the first date selector.  I am attempting to set that value.  I am pasting the code for these columns below as well.  I have tried using ui.owner and ui.editorInput instead of ui.editor with the same results.  The error I receive is: Uncaught Error: cannot call methods on igDatePicker prior to initialization; attempted to call method 'option'

startDate is a valid date.

{
    headerText: "Begin Date", width: "130px", key: "BeginDate", dataType: "date",
    columnSettings: {
        validation: true,
        editorType: "datepicker",
        editorOptions: {
            id: "actionStepStartDate",
            required: true,
            nullable: false,
            dataMode: "text",
            minValue: new Date(asYear, asMonth, asDate),
            valueChanged: function (evt, ui) {
                startDate = ui.newValue;
            }
        }
    }
},
{
    headerText: "End Date/<br />Deadline", key: "EndDate", dataType: "date",
    columnSettings: {
        validation: true,
        editorType: "datepicker",
        editorOptions: {
            id: "actionStepEndDate",
            required: true,
            nullable: false,
            dataMode: "text",
            maxValue: asMaxDate,
            dropDownListOpening: function (evt, ui) {
                if (startDate != null) {
                    console.log(ui);
                    $(ui.editor).igDatePicker("option", "minValue", startDate);
                }
 
            }
        }
    }
},

Date Selector

Thanks!

Parents Reply Children
No Data