Author Topic: Validations in columns not working.. Help me please!  (Read 1845 times)

dnk

  • Newbie
  • *
  • Posts: 2
    • View Profile
Validations in columns not working.. Help me please!
« on: March 11, 2021, 09:47:39 pm »
   , { title: "Begin", width: "20%", dataType: "string", dataIndx: "begin",
                    editor: {
                                type: "select",
                                valueIndx: "id",
                                labelIndx: "text",
                                mapIndices: { id: "beginMonthID", text: "begin"},
                                options: [],
                                init: function (ui) {
                                                        ui.$cell.find("select").pqSelect();
                                                    }
                            }
                    , validations: [
                        { type: 'minLen', value: 1, msg: "Required"}
                        ,{
                            type: function(ui) {
                              debugger;  // not go in this line
                              let value = ui.value,
                              checked = false;
                              if (value === null || value.len === 0)
                                  {
                                      ui.message = "Сould not be restricted empty value !"
                                  }
                              else
                                  {
                                      checked = true;
                                  }
                              return checked;
                            }
                        }
                        ]       

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6126
    • View Profile
Re: Validations in columns not working.. Help me please!
« Reply #1 on: March 18, 2021, 01:15:12 pm »
Please share a jsfiddle.

dnk

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Validations in columns not working.. Help me please!
« Reply #2 on: March 29, 2021, 06:04:57 pm »
Solved! but....
This not worked - , editModel: { clicksToEdit: 1, saveKey: $.ui.keyCode.ENTER,  uponSave: 'next' }
this worked - , editModel: { clicksToEdit: 1, saveKey: $.ui.keyCode.ENTER,  uponSave: 'next',
                    onBlur: 'validate', allowInvalid: false, invalidClass: 'pq-cell-red-tr pq-has-tooltip', warnClass: 'pq-cell-blue-tr pq-has-tooltip',
                    validate: true }