jQWidgets Forums

jQuery UI Widgets Forums Grid Dont want error message when validation return false

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 12 years, 3 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • akshatha
    Member

    Hi,

    I have one UI which uses jqxgrid to modify data, if i change any data one alert will come for confirming the changes. but for datetimeinput if i dont chage the date also alert was coming, somehow i could able to compare oldDate and newDate, if they are equal i have to retur false, if it is chnaged oly alert should come.
    here im pastig piece of code, plss help me with this

    {text: ‘SettlementDate’, datafield: ‘SettlementDate’, columntype: ‘datetimeinput’, cellsformat: ‘yyyy-MM-dd’,
    initeditor: function (row, cellvalue, editor) {
    oldV = cellvalue;
    },
    validation: function (cell, value) {
    if (value== ”) {
    return { result: false, message: “SettlementDate cannot be empty!” };
    }
    var newV = value;
    var oldDate = oldV.getDate() +””+ oldV.getMonth() +””+ oldV.getFullYear();
    var newDate = newV.getDate() +””+ newV.getMonth() +””+ newV.getFullYear();
    // alert(oldDate+”,”+newDate);
    if (oldDate == newDate) {
    return false;
    }
    return true;
    }

    It shows “Entered value is not valid” error when functio returns false;

    Thanks,
    Akshatha


    Peter Stoev
    Keymaster
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.