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
450
Validation for datepicker in iggrid
posted

Hi Infragistics Team,

While updating a row in grid, we have Start Date and End Date. I am stuck with validation of this column.

1.When I select Start Date, datepicker for End Date should show dates greater than Start date and previous dates should be disabled in the datepicker.

Columns -

Validation part –

  

Can you help for the above validation? Thanks!

Parents
  • 1080
    Offline posted

    Hello Tapas,

    Thank you for posting in our community.

    I have created and attached a sample illustrating the desired behavior. By handling the editCellStarting event, the rowID is retrieved and then used for getting the "BEGIN_DATE" cell value:

    ....
    editCellStarting: function (evt, ui) {
    	rowID = ui.rowID;
    }
    ....

    When opening the date picker in the "END_DATE" column, the dropDownListOpening event of the control is handled to set the minDate option to the retrieved value.

     ....
    columnKey: "END_DATE",
    editorType: "datepicker",
    editorOptions: {
    	dropDownListOpening: function (evt, ui) {
    		var BEGIN_DATE = $("#grid").igGrid("getCellText", rowID, "BEGIN_DATE");
    		if (date) BEGIN_DATE = date;
    		$(ui.editorInput[0]).datepicker("option", "minDate", new Date(BEGIN_DATE));
    		date = null;
    	}
    }
    ....

    8713.Sample.zip

Reply Children