/** * Remove all filters and redraw the data table * * @param aDTSelect * JS expression that selects 1-n datatables * @return The invocation to clear the filter. Never <code>null</code>. */ @Nonnull public static JSInvocation createClearFilterCode (@Nonnull final IJSExpression aDTSelect) { return aDTSelect.invoke ("DataTable") .invoke ("search") .arg ("") .invoke ("columns") .invoke ("search") .arg ("") .invoke ("draw"); } }
ret = ret.invoke ("on").arg ("typeahead:initialized").arg (m_aOnInitialized); if (m_aOnOpened != null) ret = ret.invoke ("on").arg ("typeahead:opened").arg (m_aOnOpened); if (m_aOnClosed != null) ret = ret.invoke ("on").arg ("typeahead:closed").arg (m_aOnClosed); if (m_aOnSelected != null) ret = ret.invoke ("on").arg ("typeahead:selected").arg (m_aOnSelected); if (m_aOnAutoCompleted != null) ret = ret.invoke ("on").arg ("typeahead:autocompleted").arg (m_aOnAutoCompleted); return ret;
/** * Update the chart with new datasets. This destroys the old chart. * * @param aJSDataVar * The data parameter used to draw the graph. * @return The JS code needed to do so. */ @Nonnull public IHasJSCode getJSUpdateCode (@Nonnull final IJSExpression aJSDataVar) { final JSPackage ret = new JSPackage (); // Cleanup old chart ret.invoke (JSExpr.ref (getJSChartVar ()), "destroy"); // Use new chart ret.assign (JSExpr.ref (getJSChartVar ()), new JSDefinedClass ("Chart")._new () .arg (JSExpr.ref (getCanvasID ()) .invoke ("getContext") .arg ("2d")) .invoke (m_aChart.getJSMethodName ()) .arg (aJSDataVar) .arg (getJSOptions ())); return ret; } }
aAPI.invoke ("column") .arg (aColumn.getCalcColumn ()) .invoke ("data") .invoke ("reduce") .arg (aReduce) .arg (0)); .arg (aColumn.getCalcColumn ()) .arg (new JSAssocArray ().add ("page", "current")) .invoke ("data") .invoke ("reduce") .arg (aReduce) .arg (0)); .add (JQuery.jQuery (aAPI.invoke ("column").arg (aColumn.getPrintColumn ()).invoke ("footer")) .html (JSExpr.invoke (aPrintSum).arg (aTotal).arg (aPageTotal)));
new JSDefinedClass ("Chart")._new () .arg (aJSCanvas.invoke ("getContext").arg ("2d")) .invoke (m_aChart.getJSMethodName ()) .arg (aJSData) .arg (aJSOptions));