EasyUI Forum
December 19, 2025, 11:32:01 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / EasyUI for jQuery / Re: There are some bugs in the tagbox plugin on: January 19, 2022, 05:58:27 PM
thank you very much for your reply!
But there are still some problems.When mode: 'remote', after entering some words in the tagbox, the drop-down list will find some matching options, but the entered words suddenly disappear. combobox does not have this problem

If I don't select any of the options in the drop-down, clicking the drop-down button again will find that the drop-down options are the ones that matched the word I just entered, not all of them.

Please override the 'tagFormatter' function to achieve your requirement.
Code:
$('#cc').tagbox({
onBeforeLoad: function(){
var data = $(this).tagbox('getData');
var opts = $(this).tagbox('options');
var values = $(this).tagbox('getValues');
opts.mappingRows = opts.mappingRows||[];
data = data.concat(opts.mappingRows);
for(var i=0; i<values.length; i++){
var item = $.easyui.getArrayItem(data, opts.valueField, values[i]);
if (item){
var row = $.easyui.getArrayItem(opts.mappingRows, opts.valueField, values[i]);
if (!row){
opts.mappingRows.push(item);
}
}
}
},
tagFormatter: function(value,row){
var opts = $(this).tagbox('options');
if (row && row[opts.textField]){
return row[opts.textField];
}
var mappingRows = opts.mappingRows||[];
var item = $.easyui.getArrayItem(mappingRows, opts.valueField, value);
return item ? item[opts.textField] : value;
}
})
2  General Category / EasyUI for jQuery / There are some bugs in the tagbox plugin on: January 16, 2022, 02:12:41 AM
Ver:1.10.1
The tagbox is inherited from the ComboBox plugin, so I can use all the properties in the ComboBox plugin. When I use mode: "remote" in tagbox I got some exceptions.
Code:
<input name="item.graph_id" class="form-control easyui-tagbox" id="graph_id"
data-options="required:true,valueField:'id',textField:'title',hasDownArrow: true,limitToList: true,
url:'#(path)/graph/listj',mode:'remote',delay:500,"
value="#(item.graph_id??)">
1、When you directly select some options from the drop-down options, and then enter some words, the selected value suddenly becomes the result of id. Finally, delete all the selected values, click the drop-down button, and find that the drop-down options are not the same as the beginning.

2、Chinese internationalization of tagbox is wrong, still in English
3  General Category / EasyUI for jQuery / Re: treegrid remove event on: December 26, 2014, 05:47:34 AM
Your json data has the wrong format, please use the 'loadFilter' function to convert your original data to correct data format.
Code:
$('#tt').treegrid({
loadFilter:function(data,parentId){
function getRows(children){
var rows = [];
function setRows(pid, children){
$.map(children, function(row){
row._parentId = pid;
rows.push(row);
if (row.children && row.children.length){
setRows(row.id, row.children);
}
row.children = undefined;
});
}
setRows(null, children);
return rows;
}
data.rows = getRows(data.rows);
return data;
}
})

thank you very much!
4  General Category / EasyUI for jQuery / Re: treegrid remove event on: December 24, 2014, 07:38:07 AM
Please confirm if you removed the node successfully. Here is the example http://jsfiddle.net/mgq8h4d2/. It works fine.

Hello , The attachment is my example。
wait on line....

In my demo,when i delete the first node then it works fine. but when i delete the other nodes ,it doesn't work
5  General Category / EasyUI for jQuery / Re: treegrid remove event on: December 24, 2014, 06:31:26 AM
The 'remove' method can remove the specified node. Please check your code carefully. If your issue continues, please provide an example to demonstrate your issue.
Code:
function deleteSubject(id){
var t = $('#tt');
$.messager.confirm('提示', '确定删除该科目?', function(r){
if(r){
var data1 = t.treegrid("getData");
console.info(data1);
t.treegrid("remove",id);
var data = t.treegrid("getData");
console.info(data);
}
});

/*var footer = t.treegrid("getFooterRows");
var json = {};
json.total = 10;
json.rows = data;
json.footer = footer;
t.treegrid("loadData",json);*/
}
6  General Category / EasyUI for jQuery / treegrid remove event on: December 23, 2014, 07:48:56 AM
t.treegrid("remove",id);
         var data = t.treegrid("getData");
         console.info(data);

This is my code . After it is called, the html dom element is removed but when I invoke the  'getData' method, the result also contains the removed data。

easyui version 1.4 。 waiting.....
7  General Category / EasyUI for jQuery / Re: Can you hepl me online ? tree onClick is NULL on: November 26, 2014, 07:37:01 AM
Please refer to the attached example 'tree_test.html'. It works fine.
Thank you very much!I change nothing,but change the version to 1.3.6 . It works well in my company code.
I also change the attached example 'tree_test.html' .
<!DOCTYPE html>
<html>
<head>
   <meta charset="UTF-8">
   <title>Basic Tree - jQuery EasyUI Demo</title>
   <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
   <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css">
   <script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.min.js"></script>
   <script type="text/javascript" src="jquery.easyui.min.js"></script>  /**this file is 1.4.1 not 1.4.1.x ,it works well now.  but It doesn't work in my company . Strange 。***/
   <script type="text/javascript">
      $(function(){
         $('#tt').tree({
            lines:true,
            animate:true,
            onClick:function(node){
               console.log(node.text);
            }
         })
      })
   </script>
</head>
8  General Category / EasyUI for jQuery / Can you hepl me online ? tree onClick is NULL on: November 26, 2014, 02:42:41 AM
$(function(){
   // 上级节点
   $('#cc').combotree();
   // 展示资源树
   $("#tt").tree({
      url:path+'/pdc_Resources/list',
      animate:true,
      lines:true,
      // 点击属性节点,表示要修改节点
      onClick:function(node){
         console.info(node); -----------------------------------------is null why?HuhHuh??
         $("#res_content").children().remove(); // 删除先前load
         // 不是点击资源管理---进入修改
         if(node.id != 0){
            $("#res_content").load(path+"/pdc_Resources/edit/"+node.id);
         }else{
            $("#res_content").load(path+"/pdc_Resources/add");
         }
      },
      onLoadSuccess:function(node,data){
         $('#cc').combotree("loadData",data)
      }      
   });
   
});

My English is so bad .
EasyUI Vesion is 1.4.1 and I have add the easyui-1.4.1-patch.zip. but it doesn't work!
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!