LigerUI的下拉框行和树的设置(表单生成)
http://blog.csdn.net/dxnn520/article/details/8194767
// ---------------------- // 【下拉树设置 -- 单选】
{display: "产品", name: "Variety_Name", comboboxName: "Variety_Name2", newline: true, labelWidth: 100, width: 180, space: 30, type: "select", options: { valueFieldID: "Variety_Id", tree: { url: "../handle/Class_CustomProducts_Handle.ashx?ajaxaction=Select_Class_Variety", checkbox: false} } },
// ---------------------- // 【下拉树设置 -- 多选框】
{display: "产品", name: "Variety_Name", comboboxName: "Variety_Name2", newline: true, labelWidth: 100, width: 180, space: 30, type: "select", options: { valueFieldID: "Variety_Id", tree: { url: "../handle/Class_CustomProducts_Handle.ashx?ajaxaction=Select_Class_Variety", checkbox: True} } },
// ---------------------- // 【下拉行设置】
{display: "产品", name: "Variety_Name", comboboxName: "Variety_Name2", newline: true, labelWidth: 100, width: 180, space: 30, type: "select", options: { valueFieldID: "Variety_Id", url: "../handle/Class_CustomProducts_Handle.ashx?ajaxaction=Select_Class_Variety", checkbox: false } },
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // 【下拉弹出选择窗口】
// ---------【1】
{display: "产品名称", name: "ProductId", comboboxName: "ProductId2", newline: true, labelWidth: 100, width: 150, space: 30, type: "select", option: { } },
// --------------- 注意:【option: { }】选项
//------【2 - 放在Form面】 -[设置下拉框的数据关联]
$.ligerui.get("ProductId2").set('onBeforeOpen', f_selectContact)
//------【3 - 放在body后面】
<div id="productdetail" style="display:none;"> <%--【弹出产品选择窗口】--%>
<div class="searchbox">
<form class="l-form">
<table>
<tr>
<td>助记码:</td><td style="width:155px"><input type="text" id="helpcodetext"/></td>
<td ><a href="javascript:void(0)" class="l-button" style="width:100px" onclick='GetClassProduct()'>查询</a></td>
<td> </td>
<td><a href="javascript:void(0)" class="l-button" style="width:100px" onclick='GetClassProductAll()'>全部显示</a></td>
</tr>
</table>
</form>
</div>
<div id="productgrid" style="margin:0px;"></div>
</div>
//------【4】
// #region ===========================================================【弹出选择产品js函数 - 放在<script type="text/javascript">下面】
var productdetail = null;
// 【弹出产品选择窗口】
function f_selectContact()
{
if (productdetail) {
productdetail.show();
}
else {
productdetail = $.ligerDialog.open
({
target: $("#productdetail"),
width: 624, height: 465, top: 15, title: "选择产品",
buttons: [
{ text: '选择', onclick: function () { selectproduct(); } },
{ text: '取消', onclick: function () { productdetail.hide(); } }
]
});
}
return false;
}
// 【将选择的产品赋值到选择框】
function selectproduct()
{
var selected = productgrid.getSelected();
if (selected) {
$("#Product_Name2").val(selected.Product_Name)
$("#Product_Name1").val(selected.Product_Id)
productdetail.hide();
}
else {
LG.tip('请选择行!');
}
}
// 【产品助记码查询事件】
function GetClassProduct()
{
var helpcode = $("#helpcodetext").val();
// if (helpcode == "") return;
productgrid.set('url', rootPath + 'handle/Class_CustomProducts_Handle.ashx?ajaxaction=Get_Class_Product&HelpCode=' + helpcode);
}
// 【全部查询事件】
function GetClassProductAll()
{
var helpcode = "SelectAll";
// if (helpcode == "") return;
productgrid.set('url', rootPath + 'handle/Class_CustomProducts_Handle.ashx?ajaxaction=Get_Class_Product&HelpCode=' + helpcode);
}
// 【产品选择表格设置】
$("#helpcodetext").ligerTextBox({ width: 150 });
var productgrid = $("#productgrid").ligerGrid({
columns: [
{ display: "产品名称", name: "Product_Name", width: 200, type: "text", align: "left" },
{ display: "助记码", name: "HelpCode", width: 150, type: "textarea", align: "left" }, //【助记码-1】
{display: "产品描述", name: "Remark", width: 400, type: "textarea", align: "left" }
],
// ---------------------------------------- // 双击选择代码 = 【开始】
onDblClickRow: function (data, rowindex, rowobj) {
selectproduct();
},
// ---------------------------------------- // 双击选择代码 = 【结束】
dataAction: 'local', pageSize: 20,
url: rootPath + 'handle/Class_CustomProducts_Handle.ashx?ajaxaction=Get_Class_Product&HelpCode=' + 'SelectAll', sortName: 'Sort',
tree: { columnName: 'Product_Name' },
width: '600', height: '370', heightDiff: -10, checkbox: false
});
//#endregion
LigerUI的下拉框行和树的设置(表单生成)的更多相关文章
- LigerUI ligerComboBox 下拉框 表格 多选无效
$("#txt1").ligerComboBox({ width: 250, slide: false, selectBoxWidth: 500, selectBoxHeight: ...
- ligerui多选动态下拉框
今天下午要求做一个支持多选的,并且插件用ligerui的,当时有点小懵了,因为没用过ligerui啊!而且按照API的介绍,我做得也很好啊,可是为什么就是显示不出来?据说有位小神比较厉害,请教来之,两 ...
- 树形下拉框ztree、获取ztree所有父节点,ztree的相关方法
参考:jQuery树形控件zTree使用小结 需求 添加.修改的终端需要选择组织,组织是多级架构(树状图显示). 思路 1.因为下拉框需要树状图显示,所以排除使用select做下拉框,改用input ...
- Jquery学习笔记:操作form表单元素之一(文本框和下拉框)
一.概述 在web页面开发中,经常需要获取和设置表单元素的值(如文本框中的内容),特别是在ajax应用中,更是常态.本文系统的介绍下如何操作. 同操作其它html元素一样,操作的过程差不多. 第一步, ...
- DEV下拉框LookUpEdit使用技巧
1,首先设置LookUpEdit要绑定的列,并配置隐藏列 2,设置下拉框是否显示表头,底部 3.设置下拉框宽度 4.设置显示的列与值列 5.设置初始值 6,绑定数据 7,取值
- Java Swing应用程序 JComboBox下拉框联动查询
在web项目中,通过下拉框.JQuery和ajax可以实现下拉框联动查询. 譬如说,当你查询某个地方时,页面上有:省份:<下拉框省份> 市区:<下拉框市区> 县乡:<下拉 ...
- DevExpress:下拉框绑定数据源 (ComboBoxEdit,LookUpEdit)
DevExpress:下拉框绑定数据源 (ComboBoxEdit,LookUpEdit) DevExpress:下拉框绑定数据源 (ComboBoxEdit,LookUpEdit) // 设置下拉框 ...
- PHP.TP框架下商品项目的优化3-php封装下拉框函数
php封装下拉框函数 因为在项目中会经常使用到下拉框,所以根据一个表中的数据制作下拉框函数,以便调用 //使用一个表的数据做下拉框函数 function buildSelect($tableName, ...
- excel 如何制作带下拉框的动态折线图表
首先我们需要有个类似下图产品销量的基础数据表. 首先将光标放入表格中任意位置,然后插入一个不带点标记的折线图,然后将折线的颜色设置为灰色. 第一次设置成灰色后,一定善用f4快捷键进行快速的折线颜色设置 ...
随机推荐
- 利用Python的smtplib和email发送邮件
原理 网上已经有了很多的教程讲解相关的发送邮件的原理,在这里还是推荐一下廖雪峰老师的Python教程,讲解通俗易懂.简要来说,SMTP是发送邮件的协议,Python内置对SMTP的支持,可以发送纯文本 ...
- Zabbix之CentOS7.3下yum安装Zabbix3.5
Zabbix特点介绍 (此介绍来源于https://www.zabbix.com/documentation/3.4/zh/manual/introduction/features) 概述Zabbix ...
- Ubuntu下rsyslog集中收集mysql审计日志
服务端 1.安装最新版本rsyslog sudo apt-get install software-properties-common python-software-properties sudo ...
- .netcore中无法使用System.Drawing --解决方案
问题重现: 无法正常使用 解决方法: 安装System.Drawing.Common的NuGet就能正常使用了 操作之后: 这个是.netcoe中的解决办法,.net framework解决方案中添 ...
- BZOJ 4260 Codechef REBXOR 01trie
好题...开阔思路 把每个前缀异或和依次插入$01trie$,插之前找一个最优的(就是从高位向低位贪心,尽量走相反方向)看看能不能更新答案,此时相当于找到了区间右端点不超过某个点$r$的最大或和$f[ ...
- Helvetic Coding Contest 2016 online mirror F1
Description Heidi has finally found the mythical Tree of Life – a legendary combinatorial structure ...
- 文件系统满的话(filesystem full),该如何处理。(du and ls)
#!/bin/bash function ergodic(){ ` do "/"$file ] then ergodic $"/"$file else loca ...
- 008 String to Integer (atoi) 字符串转换为整数
详见:https://leetcode.com/problems/string-to-integer-atoi/description/ 实现语言:Java class Solution { publ ...
- opencv——IplImage结构
一.作业要求: 采用MATLAB或opencv+C编程实现.每一题写明题目,给出试验程序代码,实验结果图片命名区分并作出效果比对,最后实验总结说明每一题蕴含的图像处理方法的效果以及应用场合等. 采用M ...
- Maven的学习资料收集--(九) 构建SSH项目以及专栏maven
在这里整合一下,使用Maven构建一个SSH项目 1.新建一个Web项目 可以参照前面的博客 2.添加依赖,修改pom.xml <project xmlns="http://maven ...