【分享】移动BOS开发 -- 底部菜单属性设置代码示例
金蝶云社区-emily
emily
5人赞赏了该文章 1,881次浏览 未经作者许可,禁止转载编辑于2018年11月01日 17:06:54

1、设置底部菜单背景
     1)移动单据列表底部菜单样式设置插件代码:
          JSON.JSONObject style = new JSON.JSONObject();
          style["FApproval"] = "background-color:#EF0000;";
          this.View.GetControl("FList").SetCustomPropertyValue("bottomMenuStyle", style);
     2)移动表单底部菜单控件样式设置插件代码:
          JSON.JSONObject style = new JSON.JSONObject();
          style["FB"] = "background-color:#EF0000;";
          style["FB_a"] = "background-color:#00EF00;width:150px;";    //子菜单
          this.View.GetControl("FTabMenuField").SetCustomPropertyValue("tabMenuStyle", style);
2、插件设置列表底部菜单
    List<BaseTabMenu> tabMenuList = new List<BaseTabMenu>();
    BaseTabMenu tabMenuApproval1 = new BaseTabMenu();
    tabMenuApproval1.Id = "FApproval";
    tabMenuApproval1.Key = "FApproval";
    tabMenuApproval1.Value = "批量审批";
    tabMenuApproval1.Type = "click"; //按钮类型,view = 菜单,click = 按钮
    string value = BaseMenuManager.ParseToString(tabMenuList);
    this.View.GetControl("FList").SetCustomPropertyValue("bottomMenuValue", value);

3、插件设置底部菜单控件
   List<BaseTabMenu> tabMenuList = new List<BaseTabMenu>(); 
   BaseTabMenu tabMenuApproval = new BaseTabMenu();
    tabMenuApproval.Id = "FApproval";
    tabMenuApproval.Key = "FApproval";
    tabMenuApproval.Value = "任务处理";
    tabMenuApproval.Type = "view"; //按钮类型,view = 菜单,click = 按钮
    tabMenuApproval.sub_button = new List<BaseTabMenu>();   
    BaseTabMenu tabMenuForward = new BaseTabMenu();
    tabMenuForward.Id = "FForward";
    tabMenuForward.Key = "FForward";
    tabMenuForward.Value = "转发";
    tabMenuForward.Type = "click"; //按钮类型,view = 菜单,click = 按钮
    tabMenuApproval.sub_button.Add(tabMenuForward);
    tabMenuList.Add(tabMenuApproval);

    tabMenuList.Add(tabMenuApproval1);

    string value = BaseMenuManager.ParseToString(tabMenuList);
    this.View.GetControl("FTabMenuField").SetCustomPropertyValue("value", value);

图标赞 5
5人点赞
还没有人点赞,快来当第一个点赞的人吧!
图标打赏
0人打赏
还没有人打赏,快来当第一个打赏的人吧!