Show Posts
|
Pages: 1 ... 4 5 [6] 7 8 ... 239
|
82
|
General Category / EasyUI for jQuery / Re: How to prevent tagbox from accepting invalid tag?
|
on: June 24, 2019, 07:14:18 AM
|
Please override the 'enter' handler to custom your tag logic. $('#tb').tagbox({ keyHandler: $.extend({}, $.fn.tagbox.defaults.keyHandler, { enter: function(e){ var t = $(this); var v = $.trim($(this).tagbox('getText')); if (v !== '' && v.length<6){ var values = $(this).tagbox('getValues'); values.push(v); $(this).tagbox('setValues', values); } } }) })
|
|
|
84
|
General Category / EasyUI for jQuery / Re: Transparent background of sidemenu
|
on: June 18, 2019, 06:57:39 PM
|
Override this style to make the sidemenu panel transparent. .sidemenu .accordion{ background: transparent; }
To show the sidemenu programmatically, please try this code. var h = $('#sm').find('.accordion').accordion('getPanel',0).panel('header'); h.tooltip('show')
|
|
|
85
|
General Category / EasyUI for jQuery / Re: SwitchButton keyboard events
|
on: June 12, 2019, 07:13:22 PM
|
Please rewrite the 'keydown.switchbutton' event handler. $('#sb').next().unbind('keydown.switchbutton').bind('keydown.switchbutton', function(e){ if (e.keyCode == 32){ var opts = $('#sb').switchbutton('options'); $('#sb').switchbutton(opts.checked ? 'uncheck' : 'check') } });
|
|
|
86
|
General Category / EasyUI for jQuery / Re: Adding a second textbox header row in datagrid
|
on: June 12, 2019, 07:05:33 PM
|
You can set the title with multiple lines, the text on the top and the input on the bottom. Please try this code. var columns = [ { field: 'itemid', title: 'Item ID<br><input class="hinput">', width: 60 }, { field: 'productid', title: 'Product<br><input class="hinput">', width: 100, ...
<style type="text/css"> .hinput{ width: 100%; } </style>
|
|
|
88
|
General Category / EasyUI for jQuery / Re: Datagrid continue editing row after negative validation check
|
on: May 20, 2019, 06:59:56 PM
|
You can define a hidden field with validatebox editor. When none of the checkbox is checked, set the validatebox editor to empty. This will prevent the datagrid from ending the editing action as the validating result is failure. Please refer to the code below: $('#dg').datagrid({ columns: [[ {field:'f1',title:'title1',width:100,editor:{type:'checkbox',options:{on:'On',off:'Off'}}}, {field:'f2',title:'title2',width:100,editor:{type:'checkbox',options:{on:'On',off:'Off'}}}, {field:'f3',title:'title3',width:100,editor:{type:'checkbox',options:{on:'On',off:'Off'}}}, {field:'f4',title:'title4',width:100,editor:{type:'checkbox',options:{on:'On',off:'Off'}}}, {field:'f5',title:'title5',width:100,editor:{type:'checkbox',options:{on:'On',off:'Off'}}}, {field:'h',title:'hidden',hidden:true,width:100,editor:{type:'validatebox',options:{required:true}}} ]], onBeginEdit: function(index,row){ var f1 = $(this).datagrid('getEditor',{index:index,field:'f1'}); var f2 = $(this).datagrid('getEditor',{index:index,field:'f2'}); var f3 = $(this).datagrid('getEditor',{index:index,field:'f3'}); var f4 = $(this).datagrid('getEditor',{index:index,field:'f4'}); var f5 = $(this).datagrid('getEditor',{index:index,field:'f5'}); var h = $(this).datagrid('getEditor',{index:index,field:'h'}); var c1 = $(f1.target).change(_changeHandler); var c2 = $(f2.target).change(_changeHandler); var c3 = $(f3.target).change(_changeHandler); var c4 = $(f4.target).change(_changeHandler); var c5 = $(f5.target).change(_changeHandler); function _changeHandler(){ if (c1.is(':checked')||c2.is(':checked')||c3.is(':checked')||c4.is(':checked')||c5.is(':checked')){ $(h.target).val(true) } else { $(h.target).val('') } } } })
|
|
|
|