EasyUI Forum
May 03, 2024, 02:22:04 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: 1 2 [3] 4 5 6
31  General Category / EasyUI for jQuery / about form load problem on: February 01, 2015, 10:08:33 PM
Code:
$.extend($.fn.form.methods, {
MyloadData : function(jq, data) {
return jq.each(function() {
load(this, data);
});

function load(target, data) {
if (!$.data(target, 'form')) {
$.data(target, 'form', {
options : $.extend({}, $.fn.form.defaults)
});
}
var opts = $.data(target, 'form').options;

if (typeof data == 'string') {
var param = {};
if (opts.onBeforeLoad.call(target, param) == false)
return;

$.ajax({
url : data,
data : param,
dataType : 'json',
success : function(data) {
_load(data);
},
error : function() {
opts.onLoadError.apply(target, arguments);
}
});
} else {
_load(data);
}
function _load(data) {
var form = $(target);
var formFields = form.find("input[name],select[name],textarea[name]");
formFields.each(function() {
var name = this.name;
var value = jQuery.proxy(function() {
try {
return eval('this.' + name);
} catch (e) {
return "";
}
}, data)();
var rr = _checkField(name, value);
if (!rr.length) {
var f = form.find("input[numberboxName=\"" + name + "\"]");
if (f.length) {
f.numberbox("setValue", value);
} else {
$("input[name=\"" + name + "\"]", form).val(value);
$("textarea[name=\"" + name + "\"]", form).val(value);
$("select[name=\"" + name + "\"]", form).val(value);
}
}
_loadCombo(name, value);
});
opts.onLoadSuccess.call(target, data);
$(target).form("validate");
}

function _checkField(name, val) {
var rr = $(target).find('input[name="' + name + '"][type=radio], input[name="' + name + '"][type=checkbox]');
rr._propAttr('checked', false);
rr.each(function() {
var f = $(this);
if (f.val() == String(val) || $.inArray(f.val(), val) >= 0) {
f._propAttr('checked', true);
}
});
return rr;
}

function _loadCombo(name, val) {
var form = $(target);
var cc = [ 'combobox', 'combotree', 'combogrid', 'datetimebox', 'datebox', 'combo' ];
var c = form.find('[comboName="' + name + '"]');
if (c.length) {
for (var i = 0; i < cc.length; i++) {
var type = cc[i];
if (c.hasClass(type + '-f')) {
if (c[type]('options').multiple) {
c[type]('setValues', val);
} else {
c[type]('setValue', val);
}
return;
}
}
}
}
}
}
});

use "MyloadData" method in easyui1.3.6 can be load this Data  {dept:{id:'001', name:'us'}} 
why easyui 1.4.1 ,is't not work?
32  General Category / Bug Report / Re: 1.4.1 Easyui-textbox Bug on: January 05, 2015, 08:05:08 PM
http://www.jeasyui.com/download/downloads/jquery-easyui-1.4.1-patch.zip   引入这个js文件即可修复。 这是官方给的
33  General Category / EasyUI for jQuery / Re: why the datagrid's filter editor have a "x"(delete all) on: January 03, 2015, 07:45:44 PM
ie9 more have this
34  General Category / EasyUI for jQuery / Re: form load question on: November 11, 2014, 08:27:18 PM
To load the form successfully, the 'user' data must be:
Code:
var user = {name:'Jion', age:18, nation:'china', 'department.id':0, department:{id:'0', name:'Defense department'}}

Forget it, I continue to use the 1.4 version
35  General Category / EasyUI for jQuery / Re: form load question on: November 11, 2014, 08:46:35 AM
or
<form id="userForm" method="post">
  <input name="department.id" class="easyui-combobox" style="width: 379px" data-options="valueField:'id',textField:'name',required:true">
</form>

or

<form id="userForm" method="post">
  <input name="department.id" class="easyui-combobox" style="width: 379px" data-options="valueField:'id',textField:'name',required:true">
</form>
36  General Category / EasyUI for jQuery / form load question on: November 11, 2014, 08:43:23 AM
How to use the form load method to load this data,
HTML:
------------------------------------------------------------------------------------------------------------
<form id="userForm" method="post">
  <select name="department.id" class="easyui-combotree" style="width: 379px"
                   data-options="url:'${ctx}/SysDepartmentController/list',editable:false,lines: true,valueField:'id',textField:'name',required:true">
</form>
------------------------------------------------------------------------------------------------------------

JSON:
------------------------------------------------------------------------------------------------------------
var user = {name:'Jion', age:18, nation:'china', department:{id:'0', name:'Defense department'}}
------------------------------------------------------------------------------------------------------------

JS:
------------------------------------------------------------------------------------------------------------
$('#userForm').form('load', user);
------------------------------------------------------------------------------------------------------------


37  General Category / EasyUI for jQuery / Re: easyui textbox keyup on: October 15, 2014, 01:09:24 AM
Please refer to this topic http://www.jeasyui.com/forum/index.php?topic=3742.0
If your issue continues, please provide an example to demonstrate your issue.

I tried using the getValue method can not obtain, but using getText method can be used normally. Ask the difference between the getValue and getText
38  General Category / EasyUI for jQuery / Re: easyui textbox keyup on: October 14, 2014, 10:08:54 PM

can't fix the problem
39  General Category / EasyUI for jQuery / easyui textbox keyup on: October 13, 2014, 09:56:17 PM
When using the textbox inputEvents add keyup, get to the current event textbox value is always the last value
40  General Category / Bug Report / Re: class="easyui-textbox" bug or ... ? on: September 14, 2014, 06:49:02 AM
多看api 和demo ,这种问题以后就别问了, 都是基础
41  General Category / Bug Report / easyui 1.4 datagrid groupview bug on: September 06, 2014, 10:55:19 PM
like this picture . error message : groups is undefiend.
42  General Category / EasyUI for jQuery / Re: 关于easyUI的datagrid修改某列显示值的问题 on: September 04, 2014, 03:17:47 AM
Translate:

Hello everyone.
I have a problem in the development of today, but I don't know how to modify the value for a column of a row in the not refresh the list of.
General effect is this: the mouse to choose a line, the onSelect event fires, sends a request to the server to modify the state, return to modify the status identification success. The front end is modified according to the result of the line (remove the title "[unread]", the font is not bold).
The attached pictures illustrate the effect to be achieved.

api datagrid updateRow 试试
43  General Category / EasyUI for jQuery / Re: about easyui datagrid in 1.4v load twice on: September 03, 2014, 08:19:55 PM
Make sure you are using the newest patch. Please try to download it from http://www.jeasyui.com/download/downloads/jquery-easyui-1.4-patch.zip.

ok, using jquery-easyui-1.4-patch.js  version 20140903 .it's fixed . thanks for your help stworthy and thank you 【aswzen】。
44  General Category / EasyUI for jQuery / Re: about easyui datagrid in 1.4v load twice on: September 02, 2014, 09:45:46 PM
Please refer to this example http://www.jeasyui.com/tutorial/datagrid/datagrid24_demo.html. It do send only one request to the remote server.

When the datagrid returns no data, there will be a request twice, if the return data is greater than 0. Then it will not repeat request

45  General Category / EasyUI for jQuery / Re: about easyui datagrid in 1.4v load twice on: September 02, 2014, 09:45:27 PM
Please refer to this example http://www.jeasyui.com/tutorial/datagrid/datagrid24_demo.html. It do send only one request to the remote server.

When the datagrid returns no data, there will be a request twice, if the return data is greater than 0. Then it will not repeat request

Pages: 1 2 [3] 4 5 6
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!