janking / dropdown Goto Github PK
View Code? Open in Web Editor NEWa lightweight dropdown of jQuery plugins
Home Page: https://janking.github.io/dropdown/
License: MIT License
a lightweight dropdown of jQuery plugins
Home Page: https://janking.github.io/dropdown/
License: MIT License
$('.dropdown-mul-1').eq(i).data('dropdown').choose(hasselect[i])
user-info.js:54 Uncaught TypeError: $(...).eq(...).data(...).choose is not a function
特殊字符串 你这边正则是不是没有过滤? data-value=“” 对于 { } 和 - 符号 好像不识别
Hi,
have a nice day,
How can i easily clear the list (delete all items).
Thanks in advance
Hello,
How do I pre-select options on load?
Can it be done via callback?
Currently there is only this "choice" option that allow a user to in a callback function. This work well if the 'label' mode is not set. When the 'label'mode is set, the 'choice' function is not being called while the user clicking the erase button from the label to deselect a button. I have also tried chain binding to the original select but it does not work too.
destroy之前没有取消控件的事件监听,会导致重新建立控件的时候出现多次触发event的BUG导致选择失效,在destroy()删除DOM元素之前先this.unbindEvent(); 可修复此BUG
how to get the multiple selected value?
Can anybody tell me how could I dynamically change the selected values for this plugin using jQuery? Thanks
当加载的数据列表中,id或name的值包含"-",解析会有问题,js中包含以下代码
var value = /value="?([\w\u4E00-\u9FA5\uF900-\uFA2D]+)"?/.exec(matcher);
If useing russian letter input where selected values is displayed is empty. can you tell me how to resolve it?
var jsonArray = [
{
"id": 1, // value值
"disabled": false, // 是否禁选
"groupName": "分组名",
"groupId": 3,//分组ID
"selected": false, // 是否选中
"name": "Betty Deborah Jackson" // 名称
},
{
"id": 2,
"disabled": false,
"groupName": "分组名",
"groupId": 2,
"selected": false,
"name": "Jason Barbara Clark"
}
]
$('#dropdown-mul').dropdown({
data: jsonArray,
multipleMode: 'label',
searchable: false,
choice: function () {
console.log(arguments, this);
}
});
定位到是selectToDiv(str)函数里的正则不对,
[\w\u4E00-\u9FA5\uF900-\uFA2D]改成[-\w\u4E00-\u9FA5\uF900-\uFA2D]就可以
var value = /value="?([-\w\u4E00-\u9FA5\uF900-\uFA2D]+)"?/.exec(matcher);
一个页面用了这个dropdown插件,同时引用了bootstrap,会跟bootstrap的dropdown插件冲突
If you have this function, please tell me. If not, I will add myself. thanks in advance.
1、.dropdown-display要加上outline:none;否则当鼠标点击的时候outline会很难看,
2、.dropdown-main的margin-top由-1改为0,否则会挡住dropdown-display的下边框
3、点击dropdown-display会打开下拉框没问题,但是第二次点击的时候应该关闭,没有关闭掉,跟原生的select行为不一致,用起来感觉很别扭的
今天发现在谷歌浏览器37.0.2062.0版本下,下拉列表都能初始化,数据也能动态加载,但是点击时没有任何反应,就跟被disabled一样,有谁可以知道对应的触发事件对象是哪个?[email protected],我的邮箱地址,希望大家能够提供一些线索
是这样,假如1.test这个选项,
我点击选择之后,1.test放入select选项框,但是我不想用1.test
而是想用test,有什么方法处理这个值然后再放进去么
如题,请问下, 怎么在回调choice中获取当前已选中的id
不支持大写检索
js文件240行,条件少了个转大写
$.each(data, function (key, value) {
if (value.name.toUpperCase().indexOf(intputValue) > -1||value.name.toLowerCase().indexOf(intputValue) > -1|| '' + value.id === '' + intputValue) {
result.push(value);
}
});
大哥,不好意思,再请教一个问题,如何在模糊搜索的时候不去搜索data-id
console.log($(this.name[0]) 得到的是
< span class="dropdown-selected">ccc< i class="del" data- id="danny">< /span>
< span class="dropdown-selected">5< i class="del" data -id="vivien">< /span>
可是怎么获取danny和vivien呢?
how to call the reset function without triggering a choice event?
当加载的数据列表中,id或name的值包含"-",解析会有问题,js中包含以下代码
var value = /value="?([\w\u4E00-\u9FA5\uF900-\uFA2D]+)"?/.exec(matcher);
Hello
I want to block selected amounts, for example; The user cannot total select 3,6,7,9,11 pieces options.
Is this possible?
Thank you.
我在使用update()方法
$(select).data('dropdown').update(dropdown_options, true)
更改选中列表时,发现下拉框更新了 但是选中列表没有更新
1.当option的value是中文的时候,dropdown无法正常的拉取键值,data-value的值全部为空
2.choice回调函数无效
望解疑
请问能否实现以下功能:
1.全选
2.optgroup点击后,其下opt全选
如何获取默认文本框的值,以及点击清除后获取值和设置默认显示的值,
业务需求,需要可以判断默认值是否为空,以及点击清除按钮后,可判断值是否为空,
以及 最后在编辑数据时,有回显
while attempting to initialize search functionality with no group tag. "Cannot read property 'toLowerCase' of undefined" will be thought at line 240
Hello, the update method to add some new options values doesn't work,
Even in your page exemple (https://janking.github.io/dropdown/).
if i select the first and last value and click on the ajax bouton to update data,
all the first data block is duplicate.
Can you correct this pb ?
Thank you
这个插件初始化的时候,使用的json格式的数据,但是我ajax请求后改变json数据option里的东西不变,使用data注入时会出现两个下拉框,所以需要销毁前面的data数据,但是销毁函数提示报错,版本是1.1
Is something wrong with the encoding or my browser, or is really every help and description in Chinese? It seems that this is far the best component I have found for my project, but I am not sure how to use it this way :( I would be really disappointed...
如何在表单中点击清除按钮,让下拉框回到初始状态。
我想问下,下拉搜索能按分组名搜索吗?文本框中输入要查询的分组名,然后筛选出该分组下的数据,麻烦指导一下,谢谢!
。。。。后来我换到不压缩版本就,可以用了
标签中默认没有option时,会报错,建议在第458行加上判断if(_this.name == null){_this.name = [];} 启动方法为什么不是$('#select_id').dropdown(.......),由插件在select上层添加一个div
当changeStatus的参数设置为disabled或readonly后,下拉列表无法恢复,除非重新加载,建议增加恢复参数
多选后 点删除按钮 ,就是输入框右边那个“x”这个按钮,清空后,重新选,会发现上次的多选的内容又显示了
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.