SQL   67

responsive rebuild

Guest on 10th May 2022 06:10:58 PM

  1. <dt-api library="Responsive">
  2. <name>responsive.rebuild()</name>
  3. <summary>Recalculate the COLUMN breakpoints based ON the class information OF the COLUMN header cells</summary>
  4. <since>1.0.4</since>
  5. <TYPE TYPE="function">
  6. <signature>responsive.rebuild()</signature>
  7. <description>Recalculate the COLUMN breakpoints based ON the class information OF the COLUMN header cells</description>
  8. <RETURNS TYPE="DataTables.Api">DataTables API instance</returns>
  9. </type>
  10. <description> It can be useful TO be able TO control the COLUMN breakpoint information that Responsive responds TO after a DataTable has been initialised. FOR example you may wish TO provide USER control OVER which COLUMNS are visible. This can be done USING code that will ADD OR remove the class `never` ([the other classes](http://datatables.net/extensions/responsive/classes) can also be used) AND THEN calling this method. You will also likely wish TO immediately CALL `r-api responsive.recalc()` TO have Responsive UPDATE the display FOR the CHANGE IN classes. HAVING this AS a separate CALL allows multiple changes TO be drawn at the same TIME TO help improve performance. </description>
  11. <example title="Hide a column completely by adding a class name and rebuilding">
  12. <![CDATA[ var TABLE = $('#example').DataTable(); $( TABLE.column( 2 ).header() ).addClass( 'never' ); TABLE.responsive.rebuild(); TABLE.responsive.recalc(); ]]>
  13. </example>
  14. </dt-api>

Raw Paste


Login or Register to edit or fork this paste. It's free.