EasyUI Forum
May 15, 2024, 12:05:55 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: Two checkboxes in datagrid auto checking together? on: October 02, 2013, 09:31:26 PM
Great. Thanks for the suggestion and help!
2  General Category / EasyUI for jQuery / Two checkboxes in datagrid auto checking together? on: September 30, 2013, 08:11:56 PM
I'm trying to use a datagrid to display a few rows of data with two columns containing a checkbox each. The problem I'm having, is that when I click one of the checkboxes in a row, the 2nd checkbox in that same row gets checked automatically (and vice-versa). Below is an example of what I'm doing. Is there a way to have two independent checkboxes in separate columns of a datagrid on the same row?

Thanks for the help!

cohoman

Code:
<body>

<table id="process-list" title="Video Processing" class="easyui-datagrid" style="width:700px;height:250px"
url="data/datagrid_data.json"
idField="itemid">
<thead>
<tr>
<th field="scan" checkbox="true">Scan</th>
<th field="cut" checkbox="true">Cut</th>
<th field="filename" width="80">Video File</th>
<th field="duration" width="120">Duration</th>
<th field="status" width="80">Status</th>
</tr>
</thead>
</table>

</body>

<script>

  jQuery("#process-list").datagrid({ data:[{filename:'rabid dog.mp4',duration:'45:25'},
                                           {filename:'hazard pay.mp4',duration:'46:25'},
                                           {filename:'granite state.mp4',duration:'47:25'}]});

</script>
3  General Category / EasyUI for jQuery / Re: Exiting tree control 'beginEdit' when clicking on a different tree item? on: July 22, 2013, 09:32:05 PM
Thanks, but it doesn't seem to be working for me. I may have some listeners that could be intercepting that lose focus message maybe? In any case, can you explain how I can initiate the "endEdit" manually?

Thanks.
4  General Category / EasyUI for jQuery / Exiting tree control 'beginEdit' when clicking on a different tree item? on: July 21, 2013, 04:34:48 PM
I'm using the following to initiate in-line editing of a tree item label:

Code:
jQuery("#tree_control").tree( { onDblClick: function(node){ jQuery(this).tree('beginEdit',node.target); } });

This works fine. Currently, I have to press the "return" key my keyboard to exit editing mode. Is there a way to exit editing by clicking on a different tree item, or anywhere else on the tree? I tried to use the following call when clicking on a tree item, and my code fails to execute the function:

Code:
var selected_node = jQuery("#tree_control").tree('getSelected');    
jQuery("#tree_control").tree('endEdit',selected_node.id);      // - FAILS TO EXECUTE
jQuery("#tree_control").tree('endEdit',selected_node.target); // - FAILS TO EXECUTE

Your help is appreciated!

Thanks.
5  General Category / EasyUI for jQuery / Re: Tree plugin, preventing drag-n-drop of item for siblings on: February 12, 2013, 07:22:34 PM
Excellent! A one-line solution that did the trick. Thank you very much for the help.
6  General Category / EasyUI for jQuery / Re: Tree plugin, preventing drag-n-drop of item for siblings on: February 12, 2013, 04:47:48 PM
I'm having trouble implementing the suggestion of checking the supplied point argument and inserting the node. Here's what I've tried:

Code:
jQuery("#tree_control").tree( { onDrop: function(target,source,point)
   {
       var node = jQuery("#tree_control").tree("getNode",target);
       
       if ( point != "append" ) // - if point is 'top' or 'bottom'
        {
           var node_source = jQuery("#tree_control").tree("find",source.id);
           var node_w_data = jQuery("#tree_control").tree("getData",node_source.target);
          jQuery("#tree_control").tree("append", {parent:target,data:node_w_data});
          return;
        }
   }}); 
     

So when the user drags a source node over to a target node and tries to drop the node just before or just after the target node, I want to append a new node as a child to the target node with the same data as the source node (later, I'll delete the original source node that was moved and dropped in the undesired location).

But when I try this, the new node doesn't appear! I still see the original node moved to undesired location, but my new node isn't present. Any comments or suggestions are appreciated.

Thanks.
7  General Category / EasyUI for jQuery / Re: Tree plugin, preventing drag-n-drop of item for siblings on: February 11, 2013, 05:56:20 PM
Thanks for the suggestion. I was trying to handle the onDragOver event checking the target node and looking to see if it had a "tree-node-append' class. I then returned false if it did not have this class, but that seemed to alter the classes of all the rejected target nodes permanently!

8  General Category / EasyUI for jQuery / Tree plugin, preventing drag-n-drop of item for siblings on: February 10, 2013, 09:29:21 PM
I'm using the jQuery EasyUI Tree plugin with my javascript coding, and I have the drag-n-drop feature activated. I'm filtering in the "onDragOver" method for the tree, returning FALSE under certain conditions when I don't want the dragged node to be drop on certain target nodes. It all seems to work well.

My problem is, I only want a dragged node to allowed to be dropped directly on a target node in the tree list. I want to prevent the ability of the dragged node from being dropped "before" or "after" a node. So essentially I only want a dragged node to become a child of another node when dropped on it, and not allow it to be dropped before or after the target node and become a sibling of the target node.

I've search through the EasyUI source code, but can't find where the drop operation is occurring and how it works (difficult to read coding when it has been minimized). Any help is greatly appreciated. Thanks!
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!