首页 \ 问答 \ jqGrid - 滚动条出现在冻结列标题中(jqGrid - scrollbar appears in frozen column header)

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.

enter image description here

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
更新时间:2022-02-18 15:02

最满意答案

谢谢你们的帮助,下面是我通过编写序列化程序解决它的方法:

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 ...
  • 谢谢你们的帮助,下面是我通过编写序列化程序解决它的方法: 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 ...
  • 我打赌你可以用 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 ...
  • 如果将列声明为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 ...
  • 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 ...
  • 您将四舍五入到小数点后两位。 你正在使用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 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)