在上篇《基于Metronic的Bootstrap开发框架经验总结(2)--列表分页处理和插件JSTree的使用》介绍了数据的分页处理,使用了Bootstrap Paginator插件,另外对树形列表,采用了JSTree插件,本篇继续介绍在编辑页面中常用到的控件Select2,这个控件可以更加丰富传统的Select下拉列表控件,提供更多的功能和更好的用户体验。 1、Select2控件介绍 这个插件是基于Select的扩展插件,能够提供更加丰富的功能和用户体验,它的github官网地址为:https://sel
ui-select指令 ui-select的指令和事件 属性 选项 描述 值 默认值 multiple 多选,直接加上multiple属性 close-on-select 在多选情况下,选中一项,就关闭下拉项 boolean true append-to-body 在多选情况下,选中项追加显示 boolean false ng-disabled 控件被禁用 boolean true ng-model 控件绑定对象 String,number,array undefined search-enabled
最近在项目啊开发中需要从下拉列表中获取游戏ID,而后台游戏数据有将近25万条,这种情况下是不可能实现一次性加载的,只能分批异步加载。找了很多插件,都没有合适的,也想过自己做一个插件,无奈时间有限,任务比较紧,只能借助第三方插件,缩短项目时间。最终找到了select2这个插件。
用了这么久的Select2插件,也该写篇文章总结总结。当初感觉Select2不是特别好用,但又找不到比它更好的下拉框插件。
1、使用插件,首先要引入别人的插件了,你可以选择离线(无网络)或者在线引用的(如果有网络)。
下面介绍其前端代码,先看html页面,使用boostrap作为样式和布局,引入了bootstrap-daterangepicker插件作为日期范围选择面板,引入select2插件作为下拉选择列表,引入moment作为时间格式化工具,引入echarts作为图表库:
提交格式 "workFences": [ { "fenceId": "ew32w2wf232fwer23", "fenceName": "区域q" }, { "fenceId": "ew32w2wf232fw543r23", "fenceName": "区域b" } ], test.json {"msg":"查询成功","code":1,
A:上一期,我们回答了JS/JQuery如何获取下拉框选中的文本和值。那么今天的问题,我们可以继续聊聊下拉框了。
LOT.UI分解系列汇总:http://www.cnblogs.com/dunitian/p/4822808.html#lotui LoT.UI开源地址如下:https://github.com/dunitian/LoTCodeBase/tree/master/LoTUI 这个必须说下,本来是用Bootstrap-Select做的,很漂亮,正好后台也是Bootstrap。后来发现不能满足需求。标签有则选,没则添加 而Bootstrap-Select的文本框是不可以手动输入的==》so,用了Select2,这
https://github.com/angular-ui/ui-select/wiki
// 加载数据 $("#e11").select2({ placeholder: "Select report type", allowClear: true, data: [{id: 0, text: 'story'},{id: 1, text: 'bug'},{id: 2, text: 'task'}] }); // 加载数组 支持多选 $("#e11_2").select2({ createSearchChoice:function(term, data) { if ($(data).filter(function() { return this.text.localeCompare(term)===0; }).length===0) {return {id:term, text:term};} }, multiple: true, data: [{id: 0, text: 'story'},{id: 1, text: 'bug'},{id: 2, text: 'task'}] }); function log(e) { var e=$(""+e+""); $("#events_11").append(e); e.animate({opacity:1}, 10000, 'linear', function() { e.animate({opacity:0}, 2000, 'linear', function() {e.remove(); }); }); } // 对元素 进行事件注册 $("#e11") .on("change", function(e) { log("change "+JSON.stringify({val:e.val, added:e.added, removed:e.removed})); }) // 改变事件 .on("select2-opening", function() { log("opening"); }) // select2 打开中事件 .on("select2-open", function() { log("open"); }) // select2 打开事件 .on("select2-close", function() { log("close"); }) // select2 关闭事件 .on("select2-highlight", function(e) { log ("highlighted val="+ e.val+" choice="+ JSON.stringify(e.choice));}) // 高亮 .on("select2-selecting", function(e) { log ("selecting val="+ e.val+" choice="+ JSON.stringify(e.choice));}) // 选中事件 .on("select2-removing", function(e) { log ("removing val="+ e.val+" choice="+ JSON.stringify(e.choice));}) // 移除中事件 .on("select2-removed", function(e) { log ("removed val="+ e.val+" choice="+ JSON.stringify(e.choice));}) // 移除完毕事件 .on("select2-loaded", function(e) { log ("loaded (data property omitted for brevity)");}) // 加载中事件 .on("select2-focus", function(e) { log ("focus");}) // 获得焦点事件 .on("select2-blur", function(e) { log ("blur");}); // 失去焦点事件 $("#e11").click(function() { $("#e11").val(["AK","CO"]).trigger("change"); }); 官网文档地址是:http://select2.github.io/select2/#documentation。说再多也没用,最后我们来个实例来证明一下ajax请求远程数据,以截图为准:
关键字:Java 基于SSM框架的权限管理系统 基于 Spring Cloud Hoxton 、Spring Boot 2.2、 OAuth2 的RBAC权限管理系统 基于数据驱动视图的理念封装 element-ui,即使没有 vue 的使用经验也能快速上手 提供对常见容器化支持 Docker、Kubernetes、Rancher2 支持 提供 lambda 、stream api 、webflux 的生产实践 技术方案 核心框架:Spring WEB框架:SpringMVC ORM框架:Mybatis
由于没有使用过require,在微擎人人商城中遇到了一个需要自动复制内容的功能。头疼了一番。
基于SSM框架的权限管理系统,支持操作权限,后端采用Spring、SpringMVC、Mybatis、Shiro,前端采用adminLTE、vue.js、bootstrap-table、tree-grid、layer,对前后端进行封装,可快速完成CRUD的开发,另外基于项目结构通过代码生成器可生成前端后台部分代码,更加方便地进行二次开发。项目采用Maven分模块构建,方便扩展自定义模块。
根据select下拉框值判断当前选中的是哪个区域,并且判断当前选中区域里面的值是否为空,如果为空,则弹出弹框提示,请输入xx区域名称,以下只是一个小demo,随手复制黏贴到代码里面,能看的更加明白。
你必须在其它地方能获取到这个select标签,所以要为其设置id、class或者是name以便能得到这个标签。multiple属性是是否可以多选。option是下拉框中多选的内容。例如在angluar中,使用ng-repeat循环出来值xxx,然后放在option中供select使用。
简单的小功能,但是用起来还是蛮爽的。分享出来让更多的人有更快的开发效率,开开心心快乐编程。 如果你还没有使用过composer,你可就out了,看我的教程分享,composer简直就是必备神奇有木有。都说到这个点上了,我们赶紧使用composer进行安装吧。 不急,先来看看效果图是啥样的,不然都没心情没欲望看下去。
今天给大家讲一讲:SpringBoot快速开发框架,内容相对比较简单。开发时使用的idea工具,大家按照如下步骤进行操作就可以了。基于SSM框架的权限管理系统,支持操作权限,后端采用Spring、SpringMVC、Mybatis、Shiro,前端采用adminLTE、vue.js、bootstrap-table、tree-grid、layer,对前后端进行封装,可快速完成CRUD的开发,另外基于项目结构通过代码生成器可生成前端后台部分代码,更加方便地进行二次开发。项目采用Maven分模块构建,方便扩展自定义模块
本文使用博客园Markdown编辑器进行编辑 1.问题呈现 项目中使用了jQuery UI的Dialog控件,一般用来处理需要提示用户输入或操作的简单页面。逻辑是修改一个广告的图片和标题。 效果截图
要开始写主体页面了,好头大。 首先需要梳理一下,如果写一条接口测试需要什么东西。 不如参考一下postman和httpbin~http://httpbin.org/ 不过这个页面太卡了,我决定把它部署在本地然后再测试。 使用docker好了,也不用管那些乱七八糟的环境了。 docker run -p 80:80 kennethreitz/httpbin 建议有空可以去了解一下docker,毕竟把乱七八糟的环境装在自己的电脑上还是蛮烦的,可能一下子遇到个环境问题就浪费一天。 使用这句话就可以把kennethreitz大神写的httpbin镜像下载并在我们的80端口上开启了。
在写thymeleaf页面的时候,我为了偷懒,不想为每个select下拉列表框都写一个接口,于是这个懒人jar诞生了。该jar的核心功能是直接通过thymeleaf页面的自定义标签的属性,直接运行sql并初始化select数据。
NFine 是基于 C# 语言的极速 WEB + ORM 框架,其核心设计目标是开发迅速、代码量少、学习简单、功能强大、轻量级、易扩展,让Web开发更迅速、简单。能解决60%重复工作。 NFine项目简介 使用时请务必保留来源,请勿用于违反我国法律的web平台、如诈骗等非法平台网站。版权最终解释权归《NFine团队》所有。 NFine是一套基于ASP.NET MVC+EF6+Bootstrap开发出来的框架,源代码完全开源,可以帮助你解决C#.NET项目68%的重复工作,让开发人员远离加班! 使用 Apac
今天给大家推荐的这个项目—— MCMS是因为使用手册、部署手册非常完善,项目也有教程视频,对小白非常贴心,接私活可以直接拿去二开非常舒服。
做一个好看的页面真的是一件困难的事情,所以还是遵循复制后修改的原则,首先是借鉴httpbin页面的方式进行块状展开。
adminLTE的官方网站:adminLTE官方网站 和github:adminLTE的github
前端使用Bootstrap主题框架AdminLTE,后台使用python语言的tornado作为web框架。利用tornado的模板作为主要的动态页面生成方式,以及巧妙使用模板将json数据渲染到页面hidden元素的值,然后在js中直接用eval函数计算隐藏域的值来生成图表JavaScript插件所需的json数据来生成页面中相应的可视化图表。
工具类 方便操作对象,数组等的工具库 underscore.js lo-dash 与underscore.js的api基本一致。与underscore比其优势是,效率高;可自定义构建 Sugar 在原生对象上增加一些工具方法 functional.js 提够了一些Curry的支持 bacon.js 函数式编程,cool streamjs 用流的方式来对数组,对象进行系列操作 异步流程控制 发布订阅 eventproxy 朴灵出品 Arbiter.js q Promise风格的 Asyn
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/hotqin888/article/details/78149202
摘要总结:本文介绍了前端框架Bootstrap和Materializecss,以及如何在React中使用React-Bootstrap和react-materialize来提高前端开发效率和用户体验。
<1> jQuery由美国人John Resig创建,至今已吸引了来自世界各地的众多 javascript高手加入其team。
程序汪推荐这个项目是因为使用手册部署手册非常完善,项目也有开发教程视频对小白非常贴心,接私活可以直接拿去二开非常舒服(程序汪就这么干过,后面分享具体心得)
搭建动态博客的初衷就是想随时随地,只要一个浏览器,就能更新博客。那么就需要一个后台来管理文章,包含文章编辑器,和各种表单控件。
jquery操作select分为获取option的值、删除option、增加option、获取option的长度、清空select、判断select框中是否存在某个值。
1、bootstrap-typeahead 自动补全简单的使用教程,自动补全,使用起来看似很厉害的样子,同事使用的select2,我们老总建议我用的是typehead,发现typehead并不是很好使,先简单把使用过程总结一下,然后再使用select2看看,那个更加方便一些吧,毕竟用起来心累的东西,确实很难受啊。参考链接比较多,个人也可以自行参考,谢谢。
后台使用的springmvc+mybatis 分页使用的插件com.github.miemiedev.mybatis.paginator.domain.PageBounds;
GIS搜索框90%的代码借用GitHub上Leaflet.GeoJSONAutocomplete这个项目。这个项目是leaflet(一种简洁而强大的WebGIS js库)的一个插件,项目介绍如下:
使用封装好的框架,有时候,对于一个知识点不熟悉,可能会浪费你大把的时间,我使用displaytag主要是使用它的分页技术,但是客户提出的需求,是获取到每行的id,然后选择一个用户名称(用户id),将他们关联操作,其实业务很简单,但是获取到你想要的这一行,一开始确实难为着我了,后来才发现,很简单。
大家好,又见面了,我是你们的朋友全栈君。 Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺
关于前端框架系列的可以参考我我刚学Bootstrap时候写的LoT.UI http://www.cnblogs.com/dunitian/p/4822808.html#lotui bootstrap-
有时在使用select2插件时会遇到这种需求:一次性选择一些数据,然后根据这些数据自动选择相关项,我也遇到了这种需求并实现,这里简单讲讲我的做法:
最近一直很多事情,博客停下来好久没写了,整理下思路,把最近研究的基于Metronic的Bootstrap开发框架进行经验的总结出来和大家分享下,同时也记录自己对Bootstrap开发的学习研究的点点滴滴,希望在开一个《基于MVC4+EasyUI的Web开发框架经验总结》的系列文章,逐步介绍这个响应式框架的点点滴滴。 Bootstrap是一个前端的技术框架,很多平台都可以采用,JAVA/PHP/.NET都可以用来做前端界面,整合JQuery可以实现非常丰富的界面效果,目前也有很多Bootstrap的插件能够提
本文实例讲述了laravel框架select2多选插件初始化默认选中项操作。分享给大家供大家参考,具体如下:
往select2里面通过jquery的append添加数据,但是没有默认选择第一项,通过设置select默认选择项的方法设置该选择框的默认选择项,虽然通过$("#select").val()的方法知道该选择框有了默认选择项,但是select2显示的是placeholder的内容,如何解决?
laravel-admin的框架已经定义好的多级联动可以去官网查看,这里就不再进行赘述,但是使用中发现功能与想要的东西有些偏差,刚进来默认的时候不好用,就自己改了改,增加了一个默认的方法。
在使用select2的搜索功能时,搜索结果会显示搜索关键词,这不是我想要的,我只想让用户选择列表框实际存在的数据,再一次还是select2 3.5版本(点击打开链接)的官方文档,官方解释:
按照select2官网配置完后,搜索框弹出后无法输入内容,究竟怎么回事,于是在其他页面尝试了select2,发现可以啊,为什么在这个地方不可以,终于找到了造成这个问题的不同之处:select2在模态对话框中会失效。找到了问题所在,但不知道如何解决:百度或者google,最终找到了解决方案:
Magicodes.Admin.Core框架在ABP以及ASP.NET ZERO的基础上进行了封装和完善,目前基于.NET Core 2.0+(Framework版本),由于部分组件在.NET Core没有找到替代组件,所以真正意义上跨平台版本会在后续推出。
使用jquery的clone() 一个div元素,div中包含一个select下拉框,select下拉框用到了bootstrap-select 中 selectpicker 。 发现新增的select下拉框无法选择选项。
常用插件备份 easyui 框架 http://www.cnblogs.com/purediy/archive/2013/02/17/2914309.html 表格数据展示插件 datatables http://dt.thxopen.com/index.html 全屏滚动插件 http://www.dowebok.com/77.html My97 DatePicker 日期选择插件: 用法介绍:http://www.my97.net/dp/demo/index.htm layer弹窗插件:http
其它更多操作方法参考文档https://www.bootstrapselect.cn/methods.html
领取专属 10元无门槛券
手把手带您无忧上云