首页 > 其他分享 >easyui-textbox,高度自适应

easyui-textbox,高度自适应

时间:2023-11-23 10:58:46浏览次数:24  
标签:style easyui px 高度 height 适应 params textbox

实现方式:通过 自定义验证方法监控 input 内容输入,当出现滚动条时修改输入框高度。

//高度自适应
//params[0] input标签下textarea的初始height
$.extend($.fn.validatebox.defaults.rules, {
   textAutoHeight: {
      validator: function (value, params) {
         if (params != undefined){
            this.style.height = params[0]+'px';
            this.parentElement.style.height = this.scrollHeight+2+"px";
            this.style.height = this.scrollHeight+"px";
         }
         return true;
      },
      message: ""
   }
});


//使用
<input class="easyui-textbox" validtype="textAutoHeight[78]" data-options="editable:true, multiline: true" style="width:100%; height: 80px;" />

 

标签:style,easyui,px,高度,height,适应,params,textbox
From: https://www.cnblogs.com/yangjcBlog/p/17851064.html

相关文章

  • easyui datagrid实现通用编辑
    functionBillEdit(Jquerygrd){varself=this;this.grd=Jquerygrdthis.editIndex=undefinedthis.GetCurrentIndex=function(){letindex=nullletrow=this.grd.datagrid("getSelected")if(row!=null)......
  • echarts自适应一系列问题
    1.适配问题//需要刷新才能适配window.onresize('resize',()=>{    myChart.resize()   })//不需要刷新,动态适配宽度 window.addEventListener('resize',()=>{    myChart.resize()   })2.横纵坐标超长省略显示  triggerEve......
  • WPF --- TextBox的输入校验
    引言在WPF应用程序开发中,数据校验是确保用户输入数据的正确性和完整性的重要一环。之前在做一些参数配置功能时,最是头疼各种参数校验,查阅一些资料后,我总结了数据校验方式有两种:ValidationRuleIDataErrorInfo接下来分别介绍这两种校验方式。ValidationRuleValidationRule......
  • WPF中设置RichTextBox的行间距
    可以通过设置Paragraph的LineHeight属性来达到设置行间距的效果。privatevoidUpdateTranslate(RichTextBoxtbx,IEnumerable<BaiduTranslateInfo>items){tbx.Document.Blocks.Clear();if(items.IsNullOrEmpty())return;Paragraphpara=newPara......
  • WPF TextBox 允许输入数字及字母的工具类
    usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Text.RegularExpressions;usingSystem.Windows.Controls;usingSystem.Windows.Input;namespace命名空间{///<summary>///TextBox输入控制///&......
  • uniapp 之绘制海报 并适应机型
    之前绘制的海报出现的问题:①海报有一角圆角没体现出来②海报内容随机型,变动到其他位置(并不是想要的地方)针对于这个问题进行修改注意:海报设置的宽度与你canvas给的标签的宽高是保持一致,下面图片为完成的海报图    一、设置海报的初......
  • 【开源三方库】Easyui:基于OpenAtom OpenHarmony ArkUI深度定制的组件框架
     万冬阳公司:中国科学院软件所小组:知识体系工作组 简介Easyui是一套基于ArkTS语言开发的轻量、可靠的移动端组件库,它是对OpenAtom OpenHarmony(以下简称“OpenHarmony”) ArkUI进行深度定制的组件框架。Easyui可扩展性较强,可以基于源码进行二次开发,修改原有组件以及新增......
  • [Vue] 大屏自适应问题
     可视化大屏需要自适应各种屏幕,使用了DataV的dv-full-screen-container ,v-scale-screen,但都达不到要求,dv-full-screen-container随着屏幕缩放或分辨率变化,文字也相应变化了,v-scale-screen+DataV控件时,第一次加载页面时,DataV边框宽高没有调整过来,还需要稍微拉伸一下,触发......
  • textbox的textmode取为multiline多行时,其maxlength不起作用
    方法一: 验证控件验证(经实践可行)SettingtheMaxengthofaTextBoxwhenitisinMultiline,YoucanuseRegularExpressionValidatorcontrolasshownbelow <asp:TextBoxID="txtConclusion"MaxLength="200"TextMode="MultiLine"Height="......
  • 若依框架AjaxResult改造适应Swagger接口文档
    一、概述若依框架后端使用的响应对象AjaxResult,和Swagger存在不兼容问题,导致返回体即使使用了Swagger注解,但是Swagger接口文档中,不显示返回体的对象Swagger文档: 若依Gitee上,也存在此问题:https://gitee.com/y_project/RuoYi-Vue/commit/6805a96e533f56b86aaeecccc2693c6ff40......