jqgrid Save Cell Edit When DatePicker Is Closed

前端 未结 2 891
后悔当初
后悔当初 2020-12-20 02:59

I have the following JQGrid

    $(\"#requestTable\").jqGrid({
    url: url,
    datatype: \'json\',
    mtype: \'GET\',
    altRows: \'true\',
    colNames:          


        
相关标签:
2条回答
  • 2020-12-20 03:42

    Hi I had different problem. i.e. focusing cell after selecting date from datepicker. I fixed it the from above Answer1, even though this answer was not intended for my problem. Basically, to keep cell focused after selecting date in jQGrid, - fire 'saveCell' event on datepickers onSelect() method as showed in Answer1. - assign saveRow, & saveCol variables in beforeEditCell method.

    Thanks to all.

    0 讨论(0)
  • 2020-12-20 03:45

    You should be able to use the onSelect() event from the datePicker in combination with the saveRow() from jqGrid. Something like:

       $(element).datepicker({
          onSelect: function(dateText, inst) { 
              var $input = inst.input; // the datepicker input
              var $row = $input.parents("tr"); 
              $("#requestTable").jqGrid('saveRow',$row.attr("id"), false); // this would probably need some work, I have no experience with jqGrid
       });
    
    0 讨论(0)
提交回复
热议问题