下拉按钮控制下面菜单 Div || span显示的内容

1.效果

2.前太js

//预算数标题及数据
function initTxet() {
var servercall = new CallServer(webserviceurl.FMBudget, "initTxet", { "budgettype": CurrentCardType });
var result = servercall.Call(function (arg) {
var dl = jQuery("#callvisittext");
var dataList = JSONUtil.decode(arg);
dl.html("");
for (var z = 0; z < dataList.length; z++) {
var Card = dataList[z];
jQuery(dl).append("<span class=‘split‘ style=‘margin-right: 0px;‘>" + Card.textName + "</span>");
jQuery(dl).append("<span id=" + Card.textid + "class=‘split‘ style=‘margin-right: 12px; color: Blue; font-weight: bold; ‘ >" + Card.textAmt + "</span>");
jQuery(dl);
}
});
}

3.html 代码

<span id="callvisittext">
</span>
</div>

4. Service

/// <summary>
/// 可支付控制页面显示不同的预算数及标题
/// </summary>
/// <param name="budgettype"></param>
[WebMethod(EnableSession = true)]
public string initTxet(string budgettype)
{
var Listtext = new List<textEntity>();

switch (budgettype.ToLower())
{
case "developmentcost":
Listtext.Add(new textEntity { textid = "costNoLandBudget", textName = "开发成本双月预算:", textAmt = "0.00" });
Listtext.Add(new textEntity { textid = "costNoLandpay", textName = "双月可支付:", textAmt = "0.00" });
Listtext.Add(new textEntity { textid = "costLandBudget", textName = "||&nbsp;&nbsp;土地成本双月预算:", textAmt = "0.00" });
Listtext.Add(new textEntity { textid = "costLandpay", textName = "双月可支付:", textAmt = "0.00" });
Listtext.Add(new textEntity { textid = "costSalesexpenseBudget", textName = "||&nbsp;&nbsp;销售费用双月预算:", textAmt = "0.00" });
Listtext.Add(new textEntity { textid = "costSalesexpensepay", textName = " 双月可支付:", textAmt = "0.00" });
break;
case "generalexpenses": //管理费用
Listtext.Add(new textEntity { textid = "generalexpensesBudget", textName = "管理费用双月预算:", textAmt = "0.00" });
Listtext.Add(new textEntity { textid = "generalexpensespay", textName = "双月可支付:", textAmt = "0.00" });
break;
case "specialexpenses": //专项管理费用(合同)
Listtext.Add(new textEntity { textid = "SpecialExpensesBudget", textName = "专项管理费用(合同)双月预算:", textAmt = "0.00" });
Listtext.Add(new textEntity { textid = "SpecialExpensespay", textName = "双月可支付:", textAmt = "0.00" });
break;
case "absorbinvestment": //投融资
Listtext.Add(new textEntity { textid = "AbsorbInvestmentBudget", textName = "投融资流出双月预算:", textAmt = "0.00" });
Listtext.Add(new textEntity { textid = "AbsorbInvestmentpay", textName = "双月可支付:", textAmt = "0.00" });

break;
case "salaries": //财务类支出
Listtext.Add(new textEntity { textid = "SalariesBudget", textName = "财务类支出双月预算:", textAmt = "10,000,000,000.00" });
Listtext.Add(new textEntity { textid = "Salariespay", textName = "双月可支付:", textAmt = "10,000,000,000.00" });
break;
case "propertyinout": //经营收支
Listtext.Add(new textEntity { textid = "PropertyInOutBudget", textName = "经营成本双月预算:", textAmt = "10,000,000,000.00" });
Listtext.Add(new textEntity { textid = "PropertyInOutpay", textName = "双月可支付:", textAmt = "10,000,000,000.00" });
break;
default:
break;
}
return JsonConvert.SerializeObject(Listtext);
}

5.使用的实体类

// 可支付动态标题
public class textEntity
{
public textEntity();

public string textAmt { get; set; }
public string textid { get; set; }
public string textName { get; set; }
}
}

时间: 2024-08-07 08:37:54

下拉按钮控制下面菜单 Div || span显示的内容的相关文章

jQuery切换下拉框里面对应的div

<!DOCTYPE html><html>      <head>            <meta charset="UTF-8">            <title>jquery实现下拉框选中对应的div</title>            <script src="http://code.jquery.com/jquery-1.8.0.min.js"></script

[转]下拉按钮 C#_Winform 自定义控件

[https://workspaces.codeproject.com/elia-sarti/splitbutton-an-xp-style-dropdown-split-button] using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Design; using System.Drawing.Drawing2D; using System.Windows.Forms; na

js实现点击下拉框选中对应的div

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>js实现点击下拉框选中对应的div</title> <style type="text/css"> div{display:none;} </style> </head> <body> <select name="

Delphi 下拉按钮实现-TRzMenuButton

1 用  Raize  Button 面板里面找到  TRzMenuButton按钮,然后在界面上添加 POPMenu,输入自己要实现的多个按钮内容,之后在TRzMenuButton的属性DropDownMneu 加载POPMenu1,运行就实现了自己想要的下拉按钮. 如下图:

css+html+js实现多级下拉和弹出菜单

本文将使用css+html+js实现横向菜单.具有多级弹出菜单下拉. 首先我们来看看效果图: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvajkwMzgyOTE4Mg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" > 首先应该写html部分的代码,代码比較简单,代码例如以下: <body> <div id="men

自定义控件基础02_下拉刷新_侧拉菜单_自定义属性

自定义控件02 自定义控件 ①,纯粹自定义绘制 ②,在原生的基础上追加功能. 1,下拉刷新功能(继承ListView追加功能)(下拉刷新,加载更多,两个功能) 1.1 下拉刷新 ①创建一个类,继承ListView 创建自定义适配器,设置数据 额外:自定义控件会放到view包下 ②自定义控件的头(即下拉的时候显示的view) 推荐名称initHeaderView();在构造方法中初始化这个头 this.addHeaderView()//添加一个头布局的控件,在listView顶部添加一个头 头部u

PHP下拉按钮跳转页面

<!--分页结束--> <form name="form2" method="post" action="">  跳转到第 <select name="page" onChange="javascript:form2.submit();"> <?php for($j=1;$j<=$pagecount;$j++) { ?> <option <?

element-ui下拉按钮的用法

<el-dropdown class="avatar-container" trigger="click"> <div class="avatar-wrapper"> <el-button type="primary" size="medium"> 支付 <i class="el-icon-caret-bottom" /> </el-

下拉框里根据选择项不同,显示的图片也不同

function change(){                var photo = document.getElementById("photo");                var photoImg = document.getElementById("photoImg");                photoImg.src = photo.value;            } <select name="photo"