Author Topic: Date Picker Is not Getting Initialize inside the Modal in Html  (Read 2281 times)

logibricks

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 12
    • View Profile
Here is my code

           var dateEditor = function (ui) {
                var $cell = ui.$cell,
                    rowData = ui.rowData,
                    dataIndx = ui.dataIndx,
                    cls = ui.cls,
                    dc = $.trim(rowData[dataIndx]);
                $cell.css('padding', '0');
                var $inp = $("<input type='text' id='" + dataIndx + "' name='" + dataIndx + "' class='" + cls + " pq-date-editor' style='position: relative; z-index: 100;border: 3px solid rgba(0,0,0,0);'/>")
                .appendTo($cell)
                .val(dc).datepicker({
                    changeMonth: true,
                    changeYear: true,
                    dateFormat:"dd/mm/yy",
                    onClose: function () {
                        $inp.focus();
                    }
                });
            }
 

{ title: "Date", dataIndx: "date", width: 150, align: "center", dataType: "date", resizable: false
                  ,render: function (ui) {
                      if (ui.cellData==null)
                      {
                          return '';
                      }
                      else
                      {
                          console.log(ui.cellData);
                          var date = new Date(ui.cellData);
                          var xdd = date.getDate();
                          var xmm = (date.getMonth() + 1);
                          var xyy = date.getFullYear();
                     
                          if (parseInt(xdd)<10){xdd='0'+xdd;}
                          if (parseInt(xmm)<10){xmm='0'+xmm;}
                     
                          return xdd + '/' + xmm + '/' +  xyy;
                      }
                  }
               ,editor: {type: dateEditor}
                         },

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6282
    • View Profile
Re: Date Picker Is not Getting Initialize inside the Modal in Html
« Reply #1 on: March 11, 2019, 04:39:14 pm »
Please assign z-index in beforeShow event of datepicker.

Code: [Select]
beforeShow: function (input, inst) {
setTimeout(function(){
//assign z-index
$('.ui-datepicker').css('z-index', 999999999999);
});
},
« Last Edit: March 11, 2019, 05:59:04 pm by paramquery »