简体   繁体   English

jqgrid列中的最大值

[英]jqgrid highest value in a column

I have a jqgrid in which I have 7 column and one of them in time in milliseconds. 我有一个jqgrid,其中有7列,其中一个以毫秒为单位。

Is there a way by which I can get the highest value form a particular column? 有没有一种方法可以使我从特定的列中获得最高价值?

In short what I need is the the complete row details whether time taken is the highest? 简而言之,我需要完整的行详细信息是否花费的时间最长?

You can use footerrow: true option to add footer row to the grid. 您可以使用footerrow: true选项将页脚行添加到网格中。 Additionally you can place some additional code in loadComplete which fill the footer on every refilling of the grid. 另外,您可以在loadComplete放置一些其他代码,以在每次重新填充网格时填充页脚。 The code in loadComplete can call getCol method with "max" as the value for the last mathoperation parameter. loadComplete的代码可以使用"max"作为最后一个mathoperation参数的值来调用getCol方法。 It will get you the required value. 它会为您提供所需的值。 Then you need just call footerData with "set" action to set the calculated value in the corresponding column of the footer row. 然后,您只需要使用"set"操作调用footerData即可在页脚行的相应列中设置计算值。 Look the demo from the old answer . 旧答案看演示。 You need just replace "sum" operation used in the demo to the "max" . 您只需要将演示中使用的“ sum”运算替换为"max"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM