请选择 进入手机版 | 继续访问电脑版
 找回密码
 立即注册

QQ登录

只需一步,快速开始

aviagesystems
金牌服务用户   /  发表于:2021-10-14 09:48  /   查看:1408  /  回复:5
1金币
为了实现页面加载后自动点击第一行,我开过一个帖子,目前的解决办法是写一端JS来实现。
var className = "repeater-item-selected"
var cellName = "Manager_Invited_Comment_List";
var repeaterCellType = Forguncy.Page.getCell(cellName)._cellType;
var currentRowHelper = repeaterCellType._currentRowHelper;
currentRowHelper.bind("RepeaterCurrentRowChanged", null, function (_, args) {
    var currentIndex = args.newCurrentRowIndex;
    if(currentIndex < 0)
return;
    var container = $("div[fgcname='" + cellName + "']");
    var items = container.find(".repeater-item");
    items.removeClass(className);
    currentIndex >=0 && items.eq(currentIndex).addClass(className);
});
$(function(){
setTimeout(function(){ $(".repeater-item:first").click() }, 100);
$(".repeater-item:first").click()
});

现在遇到了新的问题,我的页面上有2个图文列表,都要实现自动点击第一行。但是这段JS放在第二个图文列表的加载命令里总是点击第一个图文列表的第一行。有没有高手可以指点一下,如何获取到相应的图文列表。

最佳答案

查看完整内容

大佬,你改一下点击的js就行了; $("[fgcname=图文列表1单元格名字]").find(".repeater-item:first"); $("[fgcname=图文列表2单元格名字]").find(".repeater-item:first");

5 个回复

倒序浏览
最佳答案
最佳答案
David.Zhong讲师达人认证 悬赏达人认证 活字格认证
超级版主   /  发表于:2021-10-14 09:48:09
来自 4#

大佬,你改一下点击的js就行了;
$("[fgcname=图文列表1单元格名字]").find(".repeater-item:first");
$("[fgcname=图文列表2单元格名字]").find(".repeater-item:first");
回复 使用道具 举报
wangpenga悬赏达人认证
银牌会员   /  发表于:2021-10-14 10:13:26
2#
工程文件或者页面的图片有吗
回复 使用道具 举报
aviagesystems
金牌服务用户   /  发表于:2021-10-14 10:22:13
3#
附上图片

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
aviagesystems
金牌服务用户   /  发表于:2021-10-14 17:08:35
5#
David.Zhong 发表于 2021-10-14 16:03
大佬,你改一下点击的js就行了;
$("[fgcname=图文列表1单元格名字]").find(".repeater-item:first");
...

感谢
回复 使用道具 举报
David.Zhong讲师达人认证 悬赏达人认证 活字格认证
超级版主   /  发表于:2021-10-14 17:10:29
6#

大佬客气了,感谢大佬支持~
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部