/// <summary> /// Attaches instance of Formwatch plugin to table. /// Formwatch plugin brings the ability of automatic triggering specified fields change /// on client, extract specified fields data and include it to request. /// It is possible to retrieve collected form data with <see cref="Form{T}(PowerTables.Query)"/> or <see cref="Form{T}(PowerTables.PowerTableRequest)"/> method. /// Formwatch plugin is quite flexible and allows you to specify selector for each field, constant values, custom /// value evaluation functions etc. /// </summary> /// <param name="configurator">Table configurator</param> /// <param name="formWatchConfig">Formwatch plugin configuration method</param> public static void WatchForm <T>(this IConfigurator configurator, Action <FormWatchBuilder <T> > formWatchConfig) { var builder = new FormWatchBuilder <T>(); formWatchConfig(builder); configurator.TableConfiguration.ReplacePluginConfig(PluginId, builder.ClientConfig); }
/// <summary> /// Allows to filter specified column by FormWatch fields value /// </summary> /// <param name="column">Column to filter</param> /// <param name="c">FormWatch builder</param> /// <returns></returns> public static FormWatchAutofilterConfiguration <TCol, TForm> ByForm <TCol, TForm>(this IColumnTargetProperty <TCol> column, FormWatchBuilder <TForm> c) { return(new FormWatchAutofilterConfiguration <TCol, TForm>(c.ClientConfig, column.ColumnConfiguration.RawColumnName)); }