javascript 获取form中针对页面数据的模糊查询,form标签为什么总是不停的加载?

HTTP/1.1 服务器太忙下拉框代码_下拉框特效_jquery下拉框代码
您当前位置: >> >>
javascript
javascript
& CopyRight , , Inc.All Rights Reserved.文章热门排行随机文章推荐文章
Access数据库的模糊查询到底是用*还是%关注我吧
今天被用了一下数据库,结果被它的模糊查询给折腾了一上午,到底是用*还是%?特此记下来事情是这样的,我用C#写了个小的窗体程序,访问数据库进行一个模糊,我先手工往Access数据库里填一些数据,然后用它的查询工具想试一下效果,直接写了一条语句:select * from news where title like '%公司%'运行没结果,汗啊,不可能吧,剔除了like的模糊查询它又没问题,邪门了,上网找啊找,有说Access中* 为匹配多个字符串,好吧把%号改为*号,运行,嘿,还真是哈,长见识了,难倒Access不支持标准SQL语句?疑惑之际,写程序去,为了快我直接就拼接了那条sql语句搁进去,调试运行,又没结果,见鬼了?死马当活马医,把*号改回%,这下又可以了,简直坑爹啊!实践告诉我:Access中* 为匹配多个字符串,但是在C#编写Access的模糊查询中必须用 %才能查询匹配%,但是,在Access中的SQL查询中只能使用 *匹配查询!大家有什么问题或技术上的想法可以在此与大家分享,也可以加入前端爱好者QQ群()一起学习进步:【Access数据库的模糊查询到底是用*还是%】
如果您觉得本文的内容对您的学习有所帮助,捐赠与共勉,支付宝(左)或微信(右)
阅读全文内容带标记的树型下拉框模糊查询 - 开源中国社区
当前访客身份:游客 [
当前位置:
发布于 日 19时,
基于ztree,带标记的树型下拉框模糊查询
代码片段(1)
1.&[代码][JavaScript]代码&&&&
// Add semicolon to prevent IIFE from being passed as argument to concatenated code.
// UMD (Universal Module Definition)
// see /umdjs/umd/blob/master/returnExports.js
(function (root, factory) {
/* global define, exports, module */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like enviroments that support module.exports,
// like Node.
module.exports = factory();
// Browser globals (root is window)
root.FuzzyTreeSelector = factory();
}(this, function () {
* &div class="fuzzy-tree-selector" id="${id}"&
id="${id-input}" placeholder="${desc}" type="text" class="fuzzy-tree-selector-input"/&
&div class="fuzzy-tree-selector-treeDiv" &
&ul id="${id-tree}" class="ztree"&&/ul&
&span class="item" value='${value}'&${name}&span style="padding-left:4cursor:pointer" class="glyphicon glyphicon-remove" aria-hidden="true"&&/span&&/span&
var FuzzyTreeSelector=function(config){
this.selectedNodes={};
this.treeData=[]; //tree的数据
$.extend(true,this,FuzzyTreeSelector.DEFAULT);
this.initValueStr='';
$.extend(true,this,config);
this.init();
FuzzyTreeSelector.DEFAULT={
//jquery对象
$input:{},
$treeDiv:{},
dataUrl:'', //tree的数据url
idField:'id',
parentIdField:'pId',
nameField:'name', //tree节点名称字段
valueField:'id', //作为值的数据字段
//说明文字
desc:'请选择', //空值描述的文字
expandAll:true,
simpleData:true,
checkOnlyChild:false,
isParent:function(record){return record.isParent===true},
onAfterSelectNode:function(name,value,treeNodes){},
selector:{
display: 'inline-block',
position: 'relative'
display:'inline-block',
margin:'1px 4px',
padding:'0px 8px',
'text-align': 'center',
'border-radius': '4px',
color: '#fff',
'background-color': '#519ee0'
padding:'0px 25px 0px 5px',
width:'200px',
height:'28px'
'treeTrigger-down':{
margin:'0px 0px 0px -32px',
display:'inline-block',
'vertical-align': 'bottom',
background:'url(data:image/base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAICAYAAAAm06XyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJtJREFUeNpiPHz4MBMDA0MrED+3sbGZxEAEOHLkSB6QkmQCavgHZHwH4olAwWIiNILUTATiXwz///8HY6ALaoD4PxAXwcTQMUgOqqYBxEeXrIJKVmDRWAGVq4WJYTMdwwAkjTXIahnBJmD6qxxIdQBxGVSoC4irgOHTjqwOq2aoASVAqhvKrQBq7ERXg1Mz1ACQzaAY6cAmDxBgAGyUr4mcnmXZAAAAAElFTkSuQmCC) no-repeat center left',
width:'32px',
height:'28px',
cursor:'pointer'
'treeTrigger-up':{
margin:'0px 0px 0px -32px',
display:'inline-block',
'vertical-align': 'bottom',
background:'url(data:image/base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAICAYAAAAm06XyAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAArElEQVQoU31QWwrCMBCsFQQvkZPkM/cpiI9YKupf8XUnyYL3yBn8Np21mxBpcGDYzc7Mps0shFCVQEQW5aO1voyTKYphBHco/XiqNlhwk/4HtdQEBPcoHNwKr7JsCr450jnXgQG02czKrM29zNRAPIgpBTOtuCCKJxFXuZiTNfF0cTY3xpzx9UdwjYd5fP+lAKXUy3v/RtujBpyf/GALsEHwzqZ/EE8DLomoHgChZrBFUTkKQQAAAABJRU5ErkJggg==) no-repeat center left',
width:'32px',
height:'28px',
cursor:'pointer'
width:'200px',
left:'8px',
top:'28px',
position:'absolute',
display:'none',
padding:'0 0 5px 0',
'z-index': 1000,
'background-color': '#fff',
border:'1px solid #cccccc',
'border-radius':3,
overflow:'auto',
'max-height':'300px'
FuzzyTreeSelector.prototype={
getValueStr:function(){
var that=this,ids=[];
for(var id in this.selectedNodes)
ids.push(this.selectedNodes[id][this.valueField]);
return ids.join(',');
render:function(){
var id=this.
//fuzzy-tree-selector
this.$id=$('#'+id);
this.$input=$('&input id="'+id+'-input" placeholder="'+this.desc+'" type="text" class="fuzzy-tree-selector-input"/&');
this.$treeDiv=$('&div class="fuzzy-tree-selector-treeDiv" &&/div&');
this.$tree=$('&ul id="'+id+'-tree" class="ztree"&&/ul&');
this.$treeTrigger=$('&span class="fuzzy-tree-selector-treeTrigger"&&/span&');
this.$id.css(this.css.selector);
this.$input.css(this.css.input);
this.$treeDiv.css(this.css.treeDiv);
this.$treeTrigger.css(this.css['treeTrigger-down']);
this.$treeDiv.append(this.$tree);
this.$id.append(this.$input);
this.$id.append(this.$treeTrigger);
this.$id.append(this.$treeDiv);
//树的容器
//初始化树
this.initTree();
initTree:function(){
var that=this,treeSetting = {
simpleData : {
enable : this.simpleData
chkStyle:this.selectType,
chkboxType: { "Y": "", "N": "" },
radioType:"all",
enable: true
selectedMulti : false
callback: {
//扩张的ztree事件:appendNodes的data.initNode之后
afterInitNode:function(treeNode){
if(that.checkOnlyChild)
treeNode.nocheck=treeNode.isP
if(treeNode.data.nocheck)
treeNode.nocheck=treeNode.data.
onCheck:function(event, treeId, treeNode){
if(treeNode.checked)
that.ztreeObj.selectNode(treeNode);
that.selectedNodes[treeNode[that.valueField]]=treeN
delete that.selectedNodes[treeNode[that.valueField]];
that.afterSelectNode();
onClick: function(event, treeId, treeNode){
if(treeNode.nocheck)
if(!treeNode.checked)
that.ztreeObj.checkNode(treeNode,true,false,true);
that.ztreeObj.checkNode(treeNode,false,false,true);
if(this.simpleData)
treeData=$.map(this.getTreeData(),function(ele){
id:ele[that.idField],
name:ele[that.nameField]||'',
pId:ele[that.parentIdField]||0,
isParent:that.isParent(ele),
nocheck:that.isParent(ele),
open:ele.open,
_value:ele[that.valueField],
treeData=$.map(this.getTreeData(),this.translateData.bind(this));
this.ztreeObj = $.fn.zTree.init(this.$tree, treeSetting, treeData);
if(this.expandAll)
this.ztreeObj.expandAll(true);
translateData:function(data){
id:data[this.idField],
name:data[this.nameField]||'',
pId:data[this.parentIdField]||0,
isParent:this.isParent(data),
nocheck:this.isParent(data),
_value:data[this.valueField],
if(data.children&&data.children.length&0)
res.children=$.map(data.children,this.translateData.bind(this));
afterSelectNode:function(){
var nameField=this.nameField,valueField=this.valueField,
htmls=[],treeNodes=[],id,
//清空item,再画item
$('.item',this.$id).remove();
for(id in this.selectedNodes)
node=this.selectedNodes[id];
treeNodes.push(node);
htmls.push('&span class="item" value="'+node[valueField]+'"&'+node[nameField]+'&span style="padding-left:4cursor:pointer" class="glyphicon glyphicon-remove" aria-hidden="true"&&/span&&/span&');
var $items=$(htmls.join(''));
$items.css(this.css.item);
this.$id.append($items);
this.onAfterSelectNode&&this.onAfterSelectNode(treeNodes);
setValue:function(value){
if(value==null)
value+='';
this.selectedNodes={};
if(value.length==0)
$.each(this.ztreeObj.getCheckedNodes(true),function(index,node){
that.ztreeObj.checkNode(node,false);
return this.afterSelectNode();
var treeNodes=$.map(value.split(','),function(v){
var treeNode=that.ztreeObj.getNodeByParam("_value",v);
if(treeNode==null)
that.ztreeObj.checkNode(treeNode, true, false);
that.selectedNodes[treeNode[that.valueField]]=treeN
return treeN
this.afterSelectNode();
getTreeData:function(){
var res=this.treeD
if(this.dataUrl)
$.ajax(this.dataUrl,{
type:'POST',
dataType:'json',
async:false
}).done(function(data){
}).fail(function(){
bind:function(){
var that=this,$treeDiv=this.$treeD
this.$treeTrigger.on('click',function(){
that.showOrHide();
this.$input.on('focus',function(){
that.$treeDiv.css('display','block');
that.$treeTrigger.css(that.css['treeTrigger-up']);
that.$input.val('');
var ztreeObj=that.ztreeO
ztreeObj.showNodes(ztreeObj.transformToArray(ztreeObj.getNodes()));
this.$id.on('click','.item .glyphicon-remove',function(){
var $ele=$(this).parent(),ztreeObj=that.ztreeObj,
node=ztreeObj.getNodeByParam("id",$ele.attr('value'),null);
ztreeObj.checkNode(node, false, false,true);
$ele.remove();
this.$input.on('keyup',function(){
var nodes = that.ztreeObj.getNodes();
that.ztreeObj.hideNodes(nodes);
nodes = that.ztreeObj.getNodesByParamFuzzy("name", this.value, null);
var res={},resShowNodes=[],reshideNodes=[];
$.each(nodes,function(index,node){
res[node.id]=
node=node.getParentNode();
}while(node!=null);
for(var id in res)
resShowNodes.push(res[id]);
$.each(resShowNodes,function(index,node){
var children=node.
children&&$.each(children,function(index,child){
if(res[child.id]==undefined)
reshideNodes.push(child);
that.ztreeObj.showNodes(resShowNodes);
that.ztreeObj.hideNodes(reshideNodes);
showOrHide:function(showOrHide){
if(showOrHide===false||this.$treeDiv.css('display')=='block')
this.$treeDiv.css('display','none');
this.$treeTrigger.css(this.css['treeTrigger-down']);
this.$input.val('');
var ztreeObj=this.ztreeO
ztreeObj.showNodes(ztreeObj.transformToArray(ztreeObj.getNodes()));
this.$treeDiv.css('display','block');
this.$treeTrigger.css(this.css['treeTrigger-up']);
init:function(){
this.render();
this.bind();
this.setValue(this.initValueStr);
return FuzzyTreeS
开源中国-程序员在线工具:
相关的代码(77)
[JavaScript]
[JavaScript]
[JavaScript]
[JavaScript]
[JavaScript]
[JavaScript]
[JavaScript]
[JavaScript]
[JavaScript]
开源从代码分享开始
v1-alpha的其它代码1234567891011121314151617181920212223242526272829303132333435363738394041424344454647&form rel=&pagerForm& method=&post& action=&#& onsubmit=&return dwzSearch(this, 'dialog');&&
&div class=&searchBar&&
& & &ul class=&searchContent&&
& & & & &li&
& & & & & & &label&客户列表:&/label&
& & & & & & &input class=&textInput& name=&orgName& value=&& type=&text&&
& & & & &/li& & & &
& & & & & & & & &div class=&subBar&&
& & & & & & & & & & &ul&
& & & & & & & & & & & & &li&&div class=&buttonActive&&
& & & & & & & & & & & & & & & & &div class=&buttonContent&&
& & & & & & & & & & & & & & & & & & &button type=&submit&&查询&/button&
& & & & & & & & & & & & & & & & &/div&
& & & & & & & & & & & & & & &/div&
& & & & & & & & & & & & &/li&
& & & & & & & & & & &/ul&
& & & & & & & & &/div&
& & & & & & &/div&
& & & & &table class=&table& layoutH=&118& targetType=&dialog& width=&100%&&
& & & & & & &thead&
& & & & & & & & &tr&
& & & & & & & & & & &th orderfield=&orgName&&客户列表&/th&
& & & & & & & & & & &th width=&80&&查找带回&/th&
& & & & & & & & &/tr&
& & & & & & &/thead&
& & & & & & &tbody&
& & & & & & & & &%
& & & & & & & & & & for (zqbp_custom cus : p) {
& & & & & & & & %&
& & & & & & & & &tr&
& & & & & & & & & & &td&&a href=&javascript:&
& & & & & & & & & & & & onclick=&$.bringBack({id:'&%=cus.getCustom_id()%&',districtName:'&%=cus.getCustom_name()%&'})&&&%=cus.getCustom_name()%&&/a&
& & & & & & & & & & &/td&
& & & & & & & & & & &td&&a class=&btnSelect&
& & & & & & & & & & & & href=&javascript:$.bringBack({id:'&%=cus.getCustom_id()%&',districtName:'&%=cus.getCustom_name()%&'})&
& & & & & & & & & & & & title=&查找带回&&选择&/a&
& & & & & & & & & & &/td&
& & & & & & & & &/tr&
& & & & & & & & &%
& & & & & & & & & & }
& & & & & & & & %&
& & & & & & &/tbody&
可不可以私信我q?真的很急!!这是我根据demo改的
action 地址写错了 不应该用#
本文出自操他妈,转载时请注明出处及相应链接。
本文永久链接: /24018.html
Ɣ回顶部

我要回帖

更多关于 javascript formdata 的文章

 

随机推荐