Hi everyone! I created a wrapper for EasyUI without dependencies!
https://github.com/Vladzimir/phpEasyUI
EasyUI
Home | Help | Search | Login | Register |
1
on: February 05, 2025, 05:40:47 AM
|
||
Started by Vladzimir - Last post by Vladzimir | ||
Hi everyone! I created a wrapper for EasyUI without dependencies!
https://github.com/Vladzimir/phpEasyUI |
2
General Category / EasyUI for jQuery / Re: [Solved]Checking tree leaf nodes selectively through javascript
on: January 31, 2025, 06:00:36 AM
|
||
Started by brucet622 - Last post by brucet622 | ||
One other note to anyone else trying this... If you have cascadeCheck on and you want to uncheck a leaf, you have to make sure the parent is also unchecked. If not, when the data is loaded, it will recheck the leaf for you. When the parent is unchecked and a leaf is unchecked but there could be other leaves checked, the system will know to set the parent to intermediate. That is the only way I've figured out to actually get a parent set to intermediate correctly.
Burce |
3
on: January 29, 2025, 03:53:05 PM
|
||
Started by brucet622 - Last post by brucet622 | ||
OK, I think I have something that might work.
1. Call the getRoots method to get the data in the tree. This will reflect any changes the user made after the initial load. 2. Modify the array to reflect what we needed. For example: roots[0].children[0].checked = true 3. call the loadData method with the modified data. This will update the tree, will set any needed states to intermediate, and most importantly NOT reload the tree from the server. Actually manually calling the check method on the node will check the node but it also caused a reload of the tree from the server, wiping out the change. Live and learn I guess.... Thanks! Bruce |
4
on: January 29, 2025, 02:36:26 PM
|
||
Started by brucet622 - Last post by brucet622 | ||
Thanks for the reply Jesper.
Let me see what I can put together for an example. I might take the demo you pointed to and then add what I'm trying to do: The tree gets loaded from the server and the user can then check or uncheck whatever they want. All that works just fine. The problem come when they have, say 100 nodes, each with a set of leaves and they want to only check one of the leaves in all the nodes. That can take 200 clicks! (100 to expand, 100 to click). What I want to do is have a button that the user can select which of those they want checked (or unchecked) and have the javascript code do that for them. Hope that makes sense.... If I do it the way I think you are suggesting, on a button press I would have to grab the contents of the tree, update it with the changes from the button, and then reload the entire tree again with this new data. That might be the only way I can do it since none of what I've been trying to do has worked so far. Worth a shot... Bruce |
5
on: January 29, 2025, 12:50:29 PM
|
||
Started by brucet622 - Last post by jega | ||
Hi.
Is it possible to see an example of what you have so far. I use both tree and treegrid in several projects and have no troubles at all. "When i set checked" are you doing it after the load ? I never do that, but set it checked already in my json data. This way the onCheck is not called. "When a leaf is checked" Sounds like it is this sample, that works just fine. https://www.jeasyui.com/demo/main/index.php?plugin=Tree&theme=material-teal&dir=ltr&pitem=&sort=asc But show an example Jesper |
6
General Category / EasyUI for jQuery / [Solved]Checking tree leaf nodes selectively through javascript
on: January 28, 2025, 11:59:59 AM
|
||
Started by brucet622 - Last post by brucet622 | ||
I have a tree that I load from the server. I have other buttons that are used to select specific leaf nodes in the tree based upon some selection. I'm having a few issues:
Before I go to the next step about filtering the data as it comes from the server based upon what things need to set, is there a better approach here? Is there a way to stop the reload of the tree automatically? Hopefully someone can point me in the right direction. Thanks in advance! Bruce |
7
on: January 20, 2025, 12:30:11 PM
|
||
Started by stephenl - Last post by stephenl | ||
Thanks jarry !- works great
one minor typo, subgrid needs to be subgrid1 Code: const row = $('#subgrid1').datagrid('getSelected'); |
8
on: January 19, 2025, 08:26:19 PM
|
||
Started by stephenl - Last post by jarry | ||
Define the 'id' property for the subgrid component and you will be able to access the selected row of the subgrid.
Code: subgrid:{ options:{ id:'subgrid1', fitColumns:true, singleSelect:true, autoUpdateDetail:false, url:'scripts/database/get_costs.php', Code: const row = $('#subgrid').datagrid('getSelected'); console.log(row); Please make sure to download the latest 'datagrid-detailview.js' file from https://www.jeasyui.com/extension/datagridview.php. |
9
on: January 19, 2025, 07:04:44 PM
|
||
Started by Wojak - Last post by jarry | ||
This issue has been fixed. Please update to the latest version.
|
10
on: January 19, 2025, 03:56:55 AM
|
||
Started by stephenl - Last post by stephenl | ||
Hello
I have a datagrid and subgrid as below Code: var conf = { options:{ fitColumns:true, toolbar:'#toolbar', columns:[[ {field:'name',title:'name',width:12}, {field:'amt1',title:'amt1',width:10,align:'right'}, {field:'amt2',title:'amt2',width:10,align:'right'}, {field:'total',title:'Total',width:10,align:'right', styler: function(value,row,index){ if (value.charAt(0) == '-'){ return 'color:red;';} }}, {field:'adjust',title:'Adjust',width:10,align:'right', styler: function(value,row,index){ if (value.charAt(0) == '-'){ return 'color:red;';} }}, {field:'balance',title:'Balance',width:10,align:'right', styler: function(value,row,index){ if (value.charAt(0) == '-'){ return 'color:red;';} }}, ]], }, subgrid:{ options:{ fitColumns:true, singleSelect:true, autoUpdateDetail:false, url:'scripts/database/get_costs.php', foreignField:function(row){ var dp = $('#yearCombo').combobox('getValue'); return { name:row.name, year:dp }}, columns:[[ {field:'date',title:'Date',width:8}, {field:'cst1',title:'Cost 1',width:7,halign:'center',align:'right', styler: function(value,row,index){ if (value.charAt(0) == '-'){ return 'color:red;';} }}, {field:'cst2',title:'Cost 2',width:7,halign:'center',align:'right'}, {field:'total_cst',title:'Total',width:7,halign:'center',align:'right'}, ]], } } }; I have a form to to edit the values from the sub grid, however this enatils adding a button to each subgrid line Is there a way to get the row values from a selected sub grid line, without adding a button on each sub grid line..., instead by using a button on the toolbar Thank you |