jQuery Grid (pqGrid) supports autofill feature similar to Excel.

It can be customized by the options autofill, fillHandle and event beforeFillHandle.

autofill: When this option is true, grid figures out the pattern or series for numbers, dates and Excel formulas.

  1. When only one cell is initially selected, it auto increment numbers by 1 and dates by 1 day.
  2. When 2 cells are initially selected, it figures out the linear equation to fill the rest of the series for numbers and dates.
  3. When 3 cells are initially selected, it figures out the quadratic equation to fill the rest of the series for numbers.

fillHandle: This option is used to display a small square at right bottom corner of a selected range of cells which when dragged horizontally or vertically to extend selection, repeats or autofills the contents of the cells lying in initial selection to the cells in final selection.

beforeFillHandle: Triggered before a fillHandle is about to be displayed at bottom right corner of a range selection. It can be cancelled by returning false. The coordinates of the cell i.e., rowIndx, rowIndxPage, rowData, column, colIndx, dataIndx are passed through ui argument to this event. This event is useful to customize autofill and fillHandle options for particular cells, columns and rows.