如何获得行号 [英] How to get the row number

查看:104
本文介绍了如何获得行号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

如何使用jquery或javascript获取表可见行索引.

也就是说,如果表由10行组成,并且在查看时只有5条可见,而其余部分位于滚动区域中,那么我的问题是如何获取当前表中可见的第一行和最后一行索引.

在此先感谢
Seshu

Hi all,

How to get the table visible row index using jquery or javascript.

ie if table consits of 10 rows and by the time of viewing only five are visible and remaining are in scroll area so here my question is how to get the first and last row index which are visible in the table present.

Thanks in Advance
Seshu

推荐答案



我了解的是,您的页面上有滚动条,如果只有5条记录可见,那么您就需要使用javascript.您想要获取当前显示的记录数量以及滚动后将显示的记录数量.我是对的吗?

如果是这种情况,那么我不认为有任何可用的解决方案来检查.这全都取决于屏幕的分辨率.某人具有高分辨率,因此他可以查看所有数据,而某人没有.您无法进行逻辑计算.

但是使用屏幕对象,您可以获得屏幕的高度,并且您已经具有该行的高度.因此,通过该计算,您可能会看到可见的行.但我不喜欢那样做.

顺便说一句,为什么您有这样的要求?

谢谢
-Amit Gajjar
Hi,

What i understand is, you have scroll bar in your page and if only 5 records are visible then you want it in javascript. you want to get how many records are currently display and how many records will be display after scroll. Am i correct ?

If this is the scenario then i don''t think so any solution available to check that. it''s all depend upon resolution of the screen. someone have high resolution so he can view all data and someone do not have. you can not calculate logically.

But using screen object you can get height of the screen and you already have height of the row. so through that calculation you may get the visible row. but i will not prefer to do that.

BTW why you have such requirement ?

Thanks
-Amit Gajjar


这篇关于如何获得行号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆