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
Setting minDate for an igDatePicker dynamically, while the igDatePicker is inside an igGrid
posted

I am unable to successfully do the above.  Here is the "BeginDate" features snippet of my code, written against the 15.2 version:

{
  columnKey: "BeginDate",
  defaultValue: new Date(asYear, asMonth, asDate),
  required: true,
  validation: true,
  editorType: "datepicker",
  editorOptions: {
    required: true,
    nullable: false,
    maxValue: asMaxDate,
    valueChanged: function (evt, ui) {
      var $endDate = $(elt).igGridUpdating("editorForKey", "EndDate");
      if ($endDate) {
        $($endDate.igEditorFilter("option", "provider").editor.element).data("igDatePicker").options.minValue = ui.newValue;
        $($endDate.igEditorFilter("option", "provider").editor.element).data("igDatePicker").options.minDate = ui.newValue;
      }
    }
  }
},

It seems to correctly set the minValue, as selecting a date prior to the min value results in the validation message popping up.  It does NOT however appear to set the minDate value correctly, as I am able to still select prior dates.

Also, of note, I see Intellisense for both "minValue" and "minDate" in Studio 2013 when editing...how can I make it so that the minDate value is dynamically set as needed?

Thanks!