EasyUI Forum
July 26, 2024, 10:40:15 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 ... 152
31  General Category / EasyUI for jQuery / Re: .treegrid('getRowIndex', row['id']) not working. Always returns a -1 on: August 17, 2023, 01:20:50 AM
The 'reload' method accepts the 'id' parameter. If the 'id' value is missing, the treegrid will reload the root node. If the 'id' value is set, the treegrid will reload the specified node.

Code:
$(grid).treegrid('reload', idvalue);

Please try to pass the node's id value to the 'reload' method if you want to reload that node.
32  General Category / EasyUI for jQuery / Re: datagrid and toolbar on: August 13, 2023, 11:49:42 PM
Please call this code to get the toolbar bound to the datagrid. And then you will be able to access the buttons in the toolbar.
Code:
var tb = $('#dg').datagrid('options').toolbar;
...
33  General Category / EasyUI for jQuery / Re: .treegrid('getRowIndex', row['id']) not working. Always returns a -1 on: August 11, 2023, 12:13:55 AM
The row index doesn't valid in the treegrid component. Please pass the row id instead.
Code:
$('#' + grid_id).treegrid('refresh',row['id']);
$('#' + grid_id).treegrid('scrollTo',row['id']);
$('#' + grid_id).treegrid('selectRow',row['id']);
$('#' + grid_id).treegrid('highlightRow',row['id']);
34  General Category / Bug Report / Re: jeasyui-passwordbox on: July 26, 2023, 07:54:20 PM
This example works fine.
https://jeasyui.com/demo/main/index.php?plugin=PasswordBox&theme=material-teal&dir=ltr&pitem=&sort=asc
35  General Category / EasyUI for jQuery / Re: Change background colour of a table cell in a treegrid with onClickCell on: July 26, 2023, 07:53:20 PM
The 'idField' property in the treegrid component is required to identify a row node. While calling the 'refreshRow' or 'refresh' methods, the parameter should be passed with the identity field value.

Code:
$(this).treegrid('refreshRow',row['id']);
// or
$(this).treegrid('refresh',row['id']);
36  General Category / EasyUI for jQuery / Re: Error on Drag and Drop Datagrid on: July 18, 2023, 11:32:04 PM
This code works fine.
Code:
<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <title>jQuery EasyUI Demo</title>
  <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/default/easyui.css">
  <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/icon.css">
  <script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.min.js"></script>
  <script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
  <script type="text/javascript" src="https://www.jeasyui.com/easyui/datagrid-dnd.js"></script>
  <script>
    var data = [
      { "text": "Epson WorkForce 845", "group": "Printer" },
      { "text": "Canon PIXMA MG5320", "group": "Printer" },
      { "text": "HP Deskjet 1000 Printer", "group": "Printer" },
      { "text": "Cisco RV110W-A-NA-K9", "group": "Firewall" },
      { "text": "ZyXEL ZyWALL USG50", "group": "Firewall" },
      { "text": "NETGEAR FVS318", "group": "Firewall" },
      { "text": "Logitech Keyboard K120", "group": "Keyboard" },
      { "text": "Microsoft Natural Ergonomic Keyboard 4000", "group": "Keyboard" },
      { "text": "Logitech Wireless Touch Keyboard K400", "group": "Keyboard" },
      { "text": "Logitech Gaming Keyboard G110", "group": "Keyboard" },
      { "text": "Nikon COOLPIX L26 16.1 MP", "group": "Camera" },
      { "text": "Canon PowerShot A1300", "group": "Camera" },
      { "text": "Canon PowerShot A2300", "group": "Camera" }
    ]
    $(function () {
      $('#dl').datalist({
        data: data,
        onLoadSuccess: function () {
          $(this).datagrid('enableDnd');
        }
      });
    })
  </script>
</head>

<body>
  <div id="dl" title="DataList" style="width:400px;height:250px">
  </div>
</body>

</html>
37  General Category / EasyUI for jQuery / Re: showEvent property to Searchbox Menu on: July 01, 2023, 01:12:31 AM
The 'showEvent' property is available now. Please update to the latest version.
38  General Category / EasyUI for jQuery / Re: DataList doesn't refresh after updateRow on: June 30, 2023, 07:26:21 PM
These codes do the same behaviour.
Code:
$('#dl').datalist('getRows')[idx] = row; // update the row value
$('#dl').datalist('refreshRow', idx);    // and then refresh it
Code:
$('#dl').datalist('updateRow', { index: idx, row: row});  // update and refresh it at the same time
39  General Category / EasyUI for jQuery / Re: Change background colour of a table cell in a treegrid with onClickCell on: June 30, 2023, 06:46:49 PM
Please define a 'styler' function for the columns to display the background color.
Code:
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>TreeGrid - jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/icon.css">
<script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.min.js"></script>
<script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
<script>
var data = {
"total": 7, "rows": [
{ "id": 1, "name": "All Tasks", "begin": "3/4/2010", "end": "3/20/2010", "progress": 60, "iconCls": "icon-ok" },
{ "id": 2, "name": "Designing", "begin": "3/4/2010", "end": "3/10/2010", "progress": 100, "_parentId": 1, "state": "closed" },
{ "id": 21, "name": "Database", "persons": 2, "begin": "3/4/2010", "end": "3/6/2010", "progress": 100, "_parentId": 2 },
{ "id": 22, "name": "UML", "persons": 1, "begin": "3/7/2010", "end": "3/8/2010", "progress": 100, "_parentId": 2 },
{ "id": 23, "name": "Export Document", "persons": 1, "begin": "3/9/2010", "end": "3/10/2010", "progress": 100, "_parentId": 2 },
{ "id": 3, "name": "Coding", "persons": 2, "begin": "3/11/2010", "end": "3/18/2010", "progress": 80 },
{ "id": 4, "name": "Testing", "persons": 1, "begin": "3/19/2010", "end": "3/20/2010", "progress": 20 }
], "footer": [
{ "name": "Total Persons:", "persons": 7, "iconCls": "icon-sum" }
]
}

function styler(value,row){
const field = this.field;
return (row['style']||{})[field];
}
$(function(){
$('#tg').treegrid({
onClickCell: function(field,row,index){
row['style'] = row['style']||{}
row['style'][field] = 'background:red;color:#fff';
$(this).treegrid('refreshRow',row['id'])
}
})
})
</script>
</head>

<body>
<table id="tg" title="TreeGrid" style="width:700px;height:250px" data-options="
iconCls: 'icon-ok',
rownumbers: true,
animate: true,
collapsible: true,
fitColumns: true,
data: data,
idField: 'id',
treeField: 'name'
">
<thead>
<tr>
<th data-options="field:'name',width:180,styler:styler">Task Name</th>
<th data-options="field:'persons',width:60,align:'right',styler:styler">Persons</th>
<th data-options="field:'begin',width:80,styler:styler">Begin Date</th>
<th data-options="field:'end',width:80,styler:styler">End Date</th>
</tr>
</thead>
</table>
</body>

</html>
40  General Category / EasyUI for jQuery / Re: NumberSpinner Long Press Increase/Decrease Values on: June 26, 2023, 08:41:08 PM
Please refer to this code.
Code:
var ns = $('#ns');
function doSpin(target, down) {
var opts = $.data(target, 'numberspinner').options;
var v = parseFloat($(target).numberbox('getValue') || opts.value) || 0;
if (down) {
v -= opts.increment;
} else {
v += opts.increment;
}
$(target).numberbox('setValue', v);
}

var opts = ns.numberspinner('options');
var icon = ns.numberspinner('getIcon', 0);
var spin = icon.find('.spinner-arrow');
spin.on('mousedown.spinner', function (e) {
var down = $(e.target).closest('.spinner-arrow').hasClass('spinner-button-bottom');
opts.longTimer1 = setInterval(function () {
doSpin(ns[0],down);
}, 100)
}).on('mouseup.spinner', function (e) {
clearInterval(opts.longTimer1)
}).on('mouseout.spinner', function (e) {
clearInterval(opts.longTimer1)
})
41  General Category / EasyUI for jQuery / Re: Tree Format on: June 20, 2023, 08:18:17 PM
Please look at this example.
Code:
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>Basic Tree - jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/icon.css">
<script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.min.js"></script>
<script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
<script>
var data = [{
"id": 1,
"text": "My Documents",
"children": [{
"id": 11,
"text": "Photos",
"state": "closed",
"children": [{
"id": 111,
"text": "Friend"
}, {
"id": 112,
"text": "Wife"
}, {
"id": 113,
"text": "Company"
}]
}, {
"id": 12,
"text": "Program Files",
"children": [{
"id": 121,
"text": "Intel"
}, {
"id": 122,
"text": "Java",
"attributes": {
"p1": "Custom Attribute1",
"p2": "Custom Attribute2"
}
}, {
"id": 123,
"text": "Microsoft Office"
}, {
"id": 124,
"text": "Games",
"checked": true
}]
}, {
"id": 13,
"text": "index.html"
}, {
"id": 14,
"text": "about.html"
}, {
"id": 15,
"text": "welcome.html"
}]
}]
$(function(){
$('#tt').tree({
data: data,
animate: true,
formatter: function(node){
return '<div>'+node.text+'</div><div>others</div>';
}
})
})
</script>
<style>
.mtree .tree-node{
min-height: 26px;
height: auto;
}
.mtree .tree-hit,.mtree .tree-icon{
vertical-align: top;
}
.mtree .tree-title{
height: auto;
}
</style>
</head>

<body>
<ul id="tt" class="mtree"></ul>


</body>

</html>
42  General Category / EasyUI for jQuery / Re: Desktop - Context Menu & Icons on: June 15, 2023, 07:52:44 PM
The context menu is available now. Please download the latest version from https://www.jeasyui.com/extension/desktop.php.
Code:
$('body').desktop({
    ...
    onShortcutContextMenu: function(e,app){
        e.preventDefault();
        $('#menu1').menu('show', {left:e.pageX,top:e.pageY});
    }

})
43  General Category / EasyUI for jQuery / Re: SideMenu Selected Color on: May 29, 2023, 12:10:41 AM
Please override the following style.
Code:
<style>
.sidemenu .tree-node-selected{
    background: #2c3b41;
    color: #fff;
}
</style>
44  General Category / General Discussion / Re: Unable to send email to sales@jeasyui.com on: May 29, 2023, 12:06:08 AM
Please send to info@jeasyui.com instead.
45  General Category / EasyUI for jQuery / Re: Double-click or Click on Tree on: May 15, 2023, 07:15:35 PM
Listen to the 'onDblClick' event on a tree, the code looks like this.
Code:
<ul class="easyui-tree" data-options="onDblClick:function(node){console.log(node)}">
...
</ul>
Pages: 1 2 [3] 4 5 ... 152
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!