Comments (4)
demo 示例已增加,可参考
http://ciaoca.github.io/cxSelect/demo/oneself.html
from cxselect.
谢谢,我把jquery.cxselect.js看了一遍,发现在218行
if ($.isArray(data)) {
这个判断条件有问题,因为我给了jsonSpace,我给它加了一个反向判断,改成 if (!$.isArray(data)) {
就生效了..
from cxselect.
上面代码不太好弄,我将文件整理成一个html,引用的是示例站上的Js,可以直接下载运行的
test3.html.zip
这个是按照demo的json数据改了一下,加了一层data,作者可以跑一下试试,它确实不生效
from cxselect.
jsonSpace
主要是为了解决使用接口获取数据,无需另外处理,方便使用。
如果是自定义的数据,直接赋值就行,没有必要使用该参数,例如: data: dataCustom.data
以及自行通过 ajax 获取到数据处理后,再调用参考:
ajax(...).done((res) => {
$('#city_china').cxSelect({
data: res.data
selects: ['province', 'city', 'area']
});
});
from cxselect.
Related Issues (20)
- 文档和DEMO链接都挂了 HOT 1
- 有没有方法让选完第一个以后 下一个select默认选中第一个,而不是“请选择” HOT 1
- 设置默认值无效 HOT 1
- data-first-title 在下拉列表无数据也显示出来可以吗 HOT 1
- 自定义数据 HOT 1
- 可以带输入搜索吗 HOT 1
- 添加option时未进行防止xss的操作
- 使用jquery 3没有反应 HOT 1
- 能不能设置第一级下拉框的值 HOT 1
- 当跟Select2一块使用时,子select不能完全联动 HOT 3
- HTML5的data自定义属性大写问题 HOT 1
- optgroup HOT 1
- select 数据命名空间 的用法是什么
- README.md 中示例代码错误 HOT 1
- 子级怎么设置默认值 HOT 6
- 不能放在id为app的div下面,请作者检查是什么原因
- 请问为什么添加了data-value看标签值已经改变,但是显示还是之前的值
- 设置了disabled 不起作用。
- 没有回显设置的api。只能初始化使用 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cxselect.