Show Posts
|
|
Pages: [1]
|
|
1
|
General Category / EasyUI for jQuery / Re: Datagrid Editor Tab Issues with onChange event
|
on: August 27, 2015, 04:57:46 AM
|
|
Hi,
Now the tab works, it will move to next field. However, because I have bind the keydown event to the datagrid as following :
if (e.keyCode == 38) { //key up resetIdleSecondsCounter(); var cell = dgOpts.finder.getTr(dg[0], index-1, 'body', 2).find('td[field="'+field+'"] div.datagrid-cell'); cell.trigger('click'); return false; } if (e.keyCode == 40) { //key down resetIdleSecondsCounter(); var cell = dgOpts.finder.getTr(dg[0], index+1, 'body', 2).find('td[field="'+field+'"] div.datagrid-cell'); cell.trigger('click'); return false; } if (e.keyCode == 13) { // enter resetIdleSecondsCounter(); var cell = dgOpts.finder.getTr(dg[0], index+1, 'body', 2).find('td[field="'+field+'"] div.datagrid-cell'); cell.trigger('click'); return false; }
Enter key works fine, it will jump to same field on the next row, the problem is with up arrow and down arrow key, when I pressed either one of them after I changed the value in vendorVol, it will jump to same field on the next row, but the value that i entered in vendorVol in the previous row is gone. The cell is empty. If you do not change the value in vendorVol and press up/down arrow key, it will be OK, the value will still be there.
onChange: function(newValue, oldValue) { //Always set the maximum value based on newValue that yield can be entered $(edVendorYield.target).numberbox({ validType: ["minValue[0]","maxYieldValue["+newValue+"]"] }).numberbox('textbox').focus(); console.log("newValue = "+newValue); }
By pressing up/down arrow key, I noticed that the newValue will be printed twice, the first being empty and second shows the new value I entered. By pressing enter key, newValue will only show once and it's showing the new value I entered correctly.
What might cause this? Thanks.
|
|
|
|
|
2
|
General Category / EasyUI for jQuery / Datagrid Editor Tab Issues with onChange event
|
on: August 26, 2015, 01:24:18 AM
|
|
Hi,
This is my datagrid.
<th field="vendorVol" width="100" editor="{type:'numberbox',options:{precision:2,validType:'minValue[0]'}}" data-options="formatter:formatDecimal"><a title="Packaging Size of the quoted item" class="easyui-tooltip">Supplier PKG SZ</a></th> <th field="vendorYield" width="100" editor="{type:'numberbox',options:{precision:2}}" data-options="formatter:formatDecimal"><a title="Yield Size of the quoted item" class="easyui-tooltip">Supplier Yield</a></th>
var edVendorVol = dg.datagrid('getEditor',{index:index,field:'vendorVol'}); var edVendorYield = dg.datagrid('getEditor',{index:index,field:'vendorYield'}); $(edVendorVol.target).numberbox({ onChange: function(newValue, oldValue) { //Always set the maximum value based on newValue that yield can be entered $(edVendorYield.target).numberbox({ validType: ["minValue[0]","maxYieldValue["+newValue+"]"] }); } })
//Custom Validation Rule $.extend($.fn.validatebox.defaults.rules, { //Does not allow 0 minValue: { validator: function(value, param){ return value > param[0]; }, message: 'Please enter a value greater than {0}.' }, //Does not allow yield to exceed packaging size maxYieldValue: { validator: function(value, param){ return value <= param; }, message: 'Yield must not exceed Packaging Size {0}.' } });
Whenever the value in vendorVol is changed, i will change the maximum value that can be entered at vendorYield input. However, whenever I edit the row and change the value in vendorVol, and press tab, the tab will lose focus, it won't go to the field "vendorYield". I've tried removing the part inside onChange block (the part which sets the validType of vendorYield), it works flawlessly (I mean the tab keystroke, it will move and focus in vendorYield)
Any advice? Thanks.
|
|
|
|
|
4
|
General Category / EasyUI for jQuery / Datagrid getChanges on checkbox not working
|
on: July 15, 2015, 11:14:38 PM
|
|
Hi,
The datagrid getChanges will not return anything even I uncheck a checked checkbox or check a unchecked checkbox. I tried putting a hidden field and changed the hidden value while checking/unchecking the checkbox, yes the hidden value is changed but getChanges won't detect changes either. <th field="supplierNegoFlag" hidden="true"></th> <th field="ck" checkbox="true"></th> <th field="savedPrice" width="100" editor="{type:'numberbox',options:{precision:3,validType:'minValue[0]'}}" data-options="formatter:formatDecimal"><a title="Supplier Revise Price" class="easyui-tooltip">Revise Price (RM)</a></th>
How to resolve that?
Thanks.
|
|
|
|
|
6
|
General Category / EasyUI for jQuery / Validatebox Tooltip does not work with bootstrap 3
|
on: June 22, 2015, 01:26:42 AM
|
|
Hi,
I am testing the sample code below and encountered error. $.extend($.fn.validatebox.defaults.rules, { minLength: { validator: function(value, param){ return value.length >= param[0]; }, message: 'Please enter at least {0} characters.' } });
<input class="easyui-validatebox" data-options="validType:'minLength[5]'">
The box will turn red however the tooltip does not show.
Uncaught TypeError: data[option] is not a function(anonymous function) @ bootstrap.js:1700 m.extend.each @ jquery-1.11.1.min.js:2 m.fn.m.each @ jquery-1.11.1.min.js:2 Plugin @ bootstrap.js:1693 _447 @ bundle-bundle_jqeasyui_head.js:6089 (anonymous function) @ bundle-bundle_jqeasyui_head.js:6051
From bootstrap.js: function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.tooltip') var options = typeof option == 'object' && option
if (!data && /destroy|hide/.test(option)) return if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) if (typeof option == 'string') data[option]() --------------> Line 1700 }) }
The line if (typeof option == 'string') data[option]() is the one giving problems.
Any idea to solve this? Thanks.
|
|
|
|
|