jqGrid - 滚动条出现在冻结列标题中(jqGrid - scrollbar appears in frozen column header)
在我的jqGrid表中,第一列是“冻结”列,它在标题中有一个滚动条,如下所示。 如果我删除'冻结'属性,滚动似乎消失。
代码:请参阅第一列中的“冻结”属性
colNames: [ "Certification Name", "Current", "Lapsing", "Lapsed", "Not Certified", "Total Certification" ], colModel: [ { name: "CertificationName", index: "CertificationName", width: 550, frozen: true }, { name: "CurrentCount", index: "CurrentCount", width: 75, sorttype: "int", align: 'center' }, { name: "LappsingCount", index: "LappsingCount", width: 75, sorttype: "int", align: 'center' }, { name: "LappsedCount", index: "LappsedCount", width: 75, sorttype: "int", align: 'center' },
如何删除滚动条或阻止滚动条出现在第一个标题列中?
注意:我使用的是jqGrid插件(版本4.6.0)
In my jqGrid table, the first column is a 'frozen' column and it is having a scroll bar in the header as shown below. If I remove the 'frozen' property, the scroll seems to disappear.
Code: See the 'frozen' property in first column
colNames: [ "Certification Name", "Current", "Lapsing", "Lapsed", "Not Certified", "Total Certification" ], colModel: [ { name: "CertificationName", index: "CertificationName", width: 550, frozen: true }, { name: "CurrentCount", index: "CurrentCount", width: 75, sorttype: "int", align: 'center' }, { name: "LappsingCount", index: "LappsingCount", width: 75, sorttype: "int", align: 'center' }, { name: "LappsedCount", index: "LappsedCount", width: 75, sorttype: "int", align: 'center' },
How do I remove the scroll bar or prevent the scroll bar from appearing in the first header column?
Note: I am using jqGrid plugin (version 4.6.0)
原文:https://stackoverflow.com/questions/29106326
最满意答案
谢谢你们的帮助,下面是我通过编写序列化程序解决它的方法:
public class BigDecimalSerializer extends JsonSerializer<BigDecimal> { @Override public void serialize(BigDecimal value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { jgen.writeString(value.setScale(2, BigDecimal.ROUND_HALF_UP).toString()); } }
和我的模型的字段:
@JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal price;
Thanks guys for your help, here is how I have solved it by writing a serializer:
public class BigDecimalSerializer extends JsonSerializer<BigDecimal> { @Override public void serialize(BigDecimal value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { jgen.writeString(value.setScale(2, BigDecimal.ROUND_HALF_UP).toString()); } }
and fields of my model:
@JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal price;
相关问答
更多-
decimal的默认比例是零,这意味着您拥有的实际上是一个整数类型。 所以,无法在不更改数据类型的情况下返回值0.5 。 如果您为该类型指定精度和decimal(18,2)如decimal(18,2) ,则它可以处理非整数数字。 比例尺是在小数点分隔符之后将存储多少个数字。 根据您的需要,您也可以考虑float和real浮点数据类型。 The default scale of a decimal is zero, which means that what you have is actually an i ...
-
大十进制舍入(Big Decimal formatting after rounding)[2023-09-11]
谢谢你们的帮助,下面是我通过编写序列化程序解决它的方法: public class BigDecimalSerializer extends JsonSerializer{ @Override public void serialize(BigDecimal value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingExc ... -
float roundedValue = round(2.0f * number) / 2.0f; NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; [formatter setMaximumFractionDigits:1]; [formatter setRoundingMode: NSNumberFormatterRoundDown]; NSString *numberString = [formatter stri ...
-
Gridview中的舍入十进制(Rounding Decimal in Gridview)[2021-12-17]
我打赌你可以用 CAST(ROUND(attempts/total,2) as DECIMAL(12,2)) 要么 attempts/CAST(total as DECIMAL(12,2)) 要么 CAST(attempts AS DECIMAL(12,2))/total I bet you could use CAST(ROUND(attempts/total,2) as DECIMAL(12,2)) OR attempts/CAST(total as DECIMAL(12,2)) OR CAS ... -
C#中的十进制舍入(Decimal Rounding in C#)[2023-05-25]
如果将列声明为decimal ,则默认“scale”为零。 您需要指定精度和比例 。 试试这个例子 : declare @d1 decimal = 1.80 declare @d2 decimal(19,4) = 1.80 select @d1, @d2; 结果: 2 1.8000 If you declare a column as decimal, the default "scale" is zero. You need to specify the precision and s ... -
Math.Round和Decimal.Round都允许您指定要舍入的小数位数。 如果您希望显示带有两个小数位的值,则需要调用ToString并使用格式说明符(如“c2”,“n2”或“f2”)指定。 Math.Round and Decimal.Round both let you specify a number of decimal places to round to. If you then want to display the value with two decimal places then ...
-
Python的百分比样式格式化不理解Decimal对象:格式化时,隐式转换为float。 碰巧的是,最接近可表示的二进制浮点数到你的x值是这样的: >>> print Decimal(float(x)) 111.1650000000000062527760746888816356658935546875 这是一个比111.165中途案例更大的111.165 ,所以它会向上移动。 同样,对于y ,最终格式化的值是这样的: >>> print Decimal(float(y)) 236.16499999999 ...
-
十进制精度问题|(Decimal Precision Issue | Big Decimal)[2022-12-10]
2401.99是double 字面值 ,实际值恰好低于该字面值 。 请改用String的BigDecimal构造函数。 2401.99 is a double literal, with an actual value just below that. Use the BigDecimal constructor from a String instead. -
只需比较而不转换为整数 var first = $('#txtFirst').val(); var second= $('#txtSecond').val(); if ( first == second ) { // they are equal } 如果你想比较多达10位小数 var first10Decimals = first.split(".").pop().substring(0,10); var second10Decimals = second.split(".").pop().s ...
-
.Net十进制舍入奇数(.Net decimal rounding oddities)[2021-10-25]
您将四舍五入到小数点后两位。 你正在使用ToEven : 当一个数字在另外两个数字之间时,它会向最接近的偶数舍入。 任何大于 21.445(> 21.445)的数字将转为21.45 任何小于或等于 21.445(<= 21.445)的数字都将转为21.44。 Math.Round(21.44500001m, 2, MidpointRounding.ToEven); //>21.445 therefore 21.45 Math.Round(21.44500000m, 2, MidpointRounding.T ...