zoukankan      html  css  js  c++  java
  • Infopath web浏览中的多项选择功能

    因为Infopath web浏览没有提供多项选择功能,如果需要这个功能,解决方案是:

    Repeating Table来实现

    从某个数据连接中读出要显示的数据,然后用重复表的形式显示出来。

    例程:

    if (!this.New) return;
                XPathNavigator root = MainDataSource.CreateNavigator();

                DataSource myDataSource = this.DataSources["DS1"];
                XPathNavigator t1 = myDataSource.CreateNavigator();
                XPathNodeIterator t2s = t1.Select("dfs:myFields/dfs:dataFields/d:DS1",NamespaceManager);

                XPathNavigator options = root.SelectSingleNode("/my:myFields/my:options", NamespaceManager);
                XPathNavigator optionFirst = root.SelectSingleNode("/my:myFields/my:options/my:option", NamespaceManager);
                XPathNavigator myText;

                myText = optionFirst.SelectSingleNode("my:Text", NamespaceManager);
                string c2;

                while (t2s.MoveNext())
                {
                    XPathNavigator myOption = optionFirst.Clone();
      
                  myText = myOption.SelectSingleNode("my:Text", NamespaceManager);
                    c2 = t2s.Current.GetAttribute("C2", "");
                    myText.SetValue(c2)
                    options.AppendChild(myOption);
                }
              
               optionFirst.DeleteSelf();

    options是重复表,包含两个节点:selected和text,selected是布尔型,text是多选框对应的文字

  • 相关阅读:
    程序人生系列之新闻发布系统 1217
    $("expr","expr")
    jQuery 插件开发by:ioryioryzhan
    jQuery插件开发全解析 by gaojiewyh
    前端水好深
    网页设计师一定要知道的网站资源
    jQuery end()方法 by keneks
    前端书籍 by 小精灵
    emacs命令速查 摘
    jquery要怎么写才能速度最快? by 大白
  • 原文地址:https://www.cnblogs.com/heli/p/1015877.html
Copyright © 2011-2022 走看看