阅读:1536 回复:0
t156965365
46

帖子

688

跟帖

4536

积分

H3 BPM互助团队
H3 BPM互助团队
  • 社区居民

待办任务分组模式下,如何保存列表的展开状态(9.2.7)

楼主#
更多 发布于:2017-10-12 15:55
如图,分组模式下默认是全部折叠的,当展开一个列表,然后点进去完成处理。
这时候会刷新待办这个页面,此时又变成全部折叠,如果有多个任务需要处理,每次都要展开。

图片:daiban.PNG


MyWorkItemByGroup.ascx文件里面有这方面的代码处理,但是这段代码是个半成品,在第一句就会报错,后面并不会执行。
var hidDisplayGroupValue = eval($("#<%=hidDisplayGroup.ClientID%>").val());
    if (!hidDisplayGroupValue) {
        $(".workflowTitle").eq(0).removeClass("collapse");
        hidDisplayGroupValue = {};
    }
    else {
        for (var o in hidDisplayGroupValue) {
            if (hidDisplayGroupValue[o]) {
                $(o).removeClass("collapse");
            }
        }
    }
      
    $(".accordion-toggle").click(function () {
        var id = this.attributes["href"].value;
      
        if (hidDisplayGroupValue[id]) {
            hidDisplayGroupValue[id] = !$(id).is(":hidden");
        }
        else {
            hidDisplayGroupValue.id = !$(id).is(":hidden");
        }
      
        $("#<%=hidDisplayGroup.ClientID%>").val(hidDisplayGroupValue);
    });


将这段代码修改后,也只是在点击查询后会保存展开状态,刷新的时候还是不会记录。
只有先展开,再提交表单的情况下,才会保存到状态。
try {
      var hidDisplayGroupValue = JSON.parse($("#<%=hidDisplayGroup.ClientID%>").val());
  } catch (e) {
     
  }
  if (!hidDisplayGroupValue) {
      $(".workflowTitle").eq(0).removeClass("collapse");
      hidDisplayGroupValue = {};
  }
  else {
      for (var o in hidDisplayGroupValue) {
          if (hidDisplayGroupValue[o]) {
              $(o).removeClass("collapse");
          }
      }
  }
     
     
  $(".accordion-toggle").click(function () {
      var id = this.attributes["href"].value;
     
      //if (hidDisplayGroupValue[id]) {
      //执行完成以后才会加hidden
      hidDisplayGroupValue[id] = $(id).is(":hidden");
      //}
      //else {
      //    hidDisplayGroupValue.id = !$(id).is(":hidden");
      //}
     
      $("#<%=hidDisplayGroup.ClientID%>").val(JSON.stringify(hidDisplayGroupValue));
  });

@武汉技术支持团队  帮忙看看有没有好点的处理方法,需要的效果就是,处理完一条待办以后,回到待办页面,分组的展开状态能保持,不用同一类型十几个待办的情况下,每次都要重新展开。
游客

返回顶部