@Nonnull default IMPLTYPE addSpanningHeaderContent (@Nullable final IHCNode aNode) { addHeaderRow ().addAndReturnCell (aNode).setColspan (getColumnCount ()); return thisAsT (); }
/** * @return The ID of the underlying table on which this object is operating. */ @Nonnull public final String getTableID () { return m_aTable.getID (); }
@Nonnull default IMPLTYPE addSpanningBodyContent (@Nullable final IHCNode aNode) { addBodyRow ().addAndReturnCell (aNode).setColspan (getColumnCount ()); return thisAsT (); }
/** * Add multiple columns at once. * * @param aCols * The columns to be added. May be <code>null</code> and may contain * <code>null</code> elements. * @return this */ @Nonnull default IMPLTYPE addColumns (@Nullable final Iterable <? extends IHCCol <?>> aCols) { if (aCols != null) for (final IHCCol <?> aCol : aCols) addColumn (aCol); return thisAsT (); }
ValueEnforcer.notEmpty (aTable.getID (), "Table must have an ID to work with DataTables!"); final HCColGroup aColGroup = aTable.getColGroup (); boolean bHasDTCol = false; final IHCNode [] aHeaderNodes = new IHCNode [aTable.getColumnCount ()]; if (aColGroup != null) if (!aTable.hasHeaderRows ()) aTable.addHeaderRow ().addCells (aHeaderNodes); else LOGGER.warn ("Table does not have a header row so DataTables may not be displayed correctly!");
final int nColumnCount = aTable.getColumnCount (); m_aColumns = new DTOrderSpec [nColumnCount]; for (final DataTablesColumnDef aColumn : aColumns) nColumnCount + " in table " + aTable.getID ()); m_aColumns[nTarget] = aColumnData; m_aRows = new CommonsArrayList <> (aTable.getBodyRowCount ()); int nCells = 0; for (final HCRow aRow : aTable.getAllBodyRows ()) aTable.getBodyRowCount () + " rows and a total of " + nCells +
@Nonnull default IMPLTYPE addSpanningFooterContent (@Nullable final IHCNode aNode) { addFooterRow ().addAndReturnCell (aNode).setColspan (getColumnCount ()); return thisAsT (); }
((IHCTable <?>) aParent).setHead ((HCTHead) aNode); else if (aNode instanceof HCTBody) ((IHCTable <?>) aParent).setBody ((HCTBody) aNode); else if (aNode instanceof HCTFoot) ((IHCTable <?>) aParent).setFoot ((HCTFoot) aNode); else if (aNode instanceof HCRow) ((IHCTable <?>) aParent).addBodyRow ((HCRow) aNode); else throw new MarkdownException ("Cannot add node " + aNode + " to " + aParent);
m_aDisplayLocale, m_eServerFilterType); UIStateRegistry.getCurrent ().registerState (m_aTable.getID (), aServerData); m_aTable.removeAllBodyRows (); m_aTable.removeAllColumns ();
@Nonnull @ReturnsMutableCopy default ICommonsList <? extends IHCCol <?>> getAllColumns () { final HCColGroup aColGroup = getColGroup (); return aColGroup != null ? aColGroup.getAllColumns () : new CommonsArrayList<> (); }
@Nonnull public static BootstrapDataTables createDefaultDataTables (@Nonnull final ILayoutExecutionContext aLEC, @Nonnull final IHCTable <?> aTable) { // Assign special table class for Bootstrap look and feel aTable.addClass (CBootstrapCSS.TABLE).addClass (CBootstrapCSS.TABLE_STRIPED).addClass (CBootstrapCSS.TABLE_SM); final BootstrapDataTables ret = new BootstrapDataTables (aTable); ret.setDisplayLocale (aLEC.getDisplayLocale ()); ret.addAllColumns (aTable); if (s_aConfigurator != null) s_aConfigurator.configure (aLEC, aTable, ret); return ret; } }
/** * Add a body row at the specified index. * * @param nIndex * The index to be used. Should be ≥ 0. * @return this for chaining * @deprecated Use {@link #addBodyRowAt(int)} instead */ @Deprecated @Nonnull default HCRow addBodyRow (@Nonnegative final int nIndex) { return addBodyRowAt (nIndex); }
/** * Add a single column. * * @param aCol * The column to be added. May be <code>null</code>. * @return this * @deprecated Use addColumn instead. */ @Nonnull @Deprecated default IMPLTYPE addColumns (@Nullable final IHCCol <?> aCol) { return addColumn (aCol); }
/** * Add the specified column at the specified index. * * @param nIndex * The index where the column should be added. Must be ≥ 0. * @param aCol * The column to be added. May be <code>null</code>. * @return this * @deprecated Use {@link #addColumnAt(int,IHCCol)} instead */ @Deprecated @Nonnull default IMPLTYPE addColumn (@Nonnegative final int nIndex, @Nullable final IHCCol <?> aCol) { return addColumnAt (nIndex, aCol); }
final HCColGroup aColGroup = aTable.getColGroup (); if (aColGroup != null)
@Nonnull public static BootstrapDataTables createDefaultDataTables (@Nonnull final ILayoutExecutionContext aLEC, @Nonnull final IHCTable <?> aTable) { // Assign special table class for Bootstrap look and feel aTable.addClass (CBootstrapCSS.TABLE).addClass (CBootstrapCSS.TABLE_STRIPED); final BootstrapDataTables ret = new BootstrapDataTables (aTable); ret.setDisplayLocale (aLEC.getDisplayLocale ()); ret.addAllColumns (aTable); if (s_aConfigurator != null) s_aConfigurator.configure (aLEC, aTable, ret); return ret; } }
/** * Add multiple columns at once. * * @param aCols * The columns to be added. May be <code>null</code> and may contain * <code>null</code> elements. * @return this */ @Nonnull default IMPLTYPE addColumns (@Nullable final IHCCol <?>... aCols) { if (aCols != null) for (final IHCCol <?> aCol : aCols) addColumn (aCol); return thisAsT (); }
/** * Add a body row at the specified index. * * @param nIndex * The index to be used. Should be ≥ 0. * @param aRow * The row to be added. May be <code>null</code>. * @return this for chaining * @deprecated Use {@link #addBodyRowAt(int,HCRow)} instead */ @Deprecated @Nonnull default IMPLTYPE addBodyRow (@Nonnegative final int nIndex, @Nullable final HCRow aRow) { return addBodyRowAt (nIndex, aRow); }
public static void init () { BootstrapDataTables.setConfigurator ( (aLEC, aTable, aDataTables) -> { final IRequestWebScopeWithoutResponse aRequestScope = aLEC.getRequestScope (); aDataTables.setAutoWidth (false) .setLengthMenu (LENGTH_MENU) .setAjaxBuilder (new JQueryAjaxBuilder ().url (CAjax.DATATABLES.getInvocationURL (aRequestScope)) .data (new JSAssocArray ().add (AjaxExecutorDataTables.OBJECT_ID, aTable.getID ()))) .setServerFilterType (EDataTablesFilterType.ALL_TERMS_PER_ROW) .setTextLoadingURL (CAjax.DATATABLES_I18N.getInvocationURL (aRequestScope), AjaxExecutorDataTablesI18N.LANGUAGE_ID) .addPlugin (new DataTablesPluginSearchHighlight ()); }); // By default allow markdown in system message BootstrapSystemMessage.setDefaultUseMarkdown (true); }
public static void init () { BootstrapDataTables.setConfigurator ( (aLEC, aTable, aDataTables) -> { final IRequestWebScopeWithoutResponse aRequestScope = aLEC.getRequestScope (); aDataTables.setAutoWidth (false) .setLengthMenu (LENGTH_MENU) .setAjaxBuilder (new JQueryAjaxBuilder ().url (CAjax.DATATABLES.getInvocationURL (aRequestScope)) .data (new JSAssocArray ().add (AjaxExecutorDataTables.OBJECT_ID, aTable.getID ()))) .setServerFilterType (EDataTablesFilterType.ALL_TERMS_PER_ROW) .setTextLoadingURL (CAjax.DATATABLES_I18N.getInvocationURL (aRequestScope), AjaxExecutorDataTablesI18N.LANGUAGE_ID) .addPlugin (new DataTablesPluginSearchHighlight ()); }); // By default allow markdown in system message BootstrapSystemMessage.setDefaultUseMarkdown (true); }