我想将滑动条与输入文本同步。它工作正常。此外,我希望在发生模糊事件时更新控件(updateon: 'blur'但我还希望在滑块更改时立即更新表单控件的值。
https://stackblitz.com/edit/angular-cakpgs
现在我的问题是:当我通过滑动条更改控件的值时,我的表单的 valuechanges 被触发两次。当我更改值时,我在公式中执行 patchValue ,因为我想立即更新该值。并且当滑动条失去焦点(模糊事件)时,再次触发 valuechanges 通知。
我该怎么做,我的公式的 valuechanges 只触发一次,要求:
updateon: 'blur'我已经定义了以下DataTemplate:
<dxg:TableView.DataRowTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<Border BorderThickness="0" BorderBrush="#D0C9A0" Style="{StaticResource borderStyle}">
<dx:MeasurePixelSnapper>
<ContentControl Content="{Binding}" ContentTemplate="{Binding View.DefaultDataRowTemplate}"/>
</dx:MeasurePixelSnapper>
</Border>
</StackPanel>
</DataTemplate>
</dxg:TableView.DataRowTemplate>
Run Code Online (Sandbox Code Playgroud)
我想在行聚焦时应用这种风格:
<Style TargetType="Border" x:Key="borderStyle">
<Setter Property="BorderThickness" Value="0"/>
<Style.Triggers>
<Trigger Property="dxg:GridViewBase.IsFocusedRow" Value="True">
<Setter Property="BorderThickness" Value="4"></Setter>
</Trigger>
</Style.Triggers>
</Style>
Run Code Online (Sandbox Code Playgroud)
为什么不起作用?我不明白为什么触发器被执行noct.有解决方案吗
我试图找到一个PreparedStatement(ps)的方法:
Method method = ps.getClass().getMethod("setLong", int.class, Class.forName("java.lang.Long"));
method.setAccessible(true);
method.invoke(ps, fieldIndex, value);
Run Code Online (Sandbox Code Playgroud)
但它没有找到.我必须使用Class.forName("java.lang.Long")而不是Long.class.
对于String,它可以工作:
Method method = ps.getClass().getMethod("setString", int.class, Class.forName("java.lang.String"));
method.setAccessible(true);
method.invoke(ps, fieldIndex, value);
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?任何的想法?Long的名称空间错了吗?
有没有ag-grid比用更好的方法来验证行valueSetter?
我可以通过它来完成验证,但是不确定是否有更好的方法。
https://www.ag-grid.com/javascript-grid-value-setters/#properties-for-setters-and-parsers
我要验证行中的两个字段。DateFrom和DateUntil(不允许为null,DateFrom必须小于DateUntil)。