EasyUI Forum

General Category => General Discussion => Topic started by: catpaw on December 04, 2014, 06:48:39 PM



Title: datagrid + draggable
Post by: catpaw on December 04, 2014, 06:48:39 PM
I'm trying to drag the entire data grid , I refer to the entire table , not only rows or a column.

What I did , but I can not drag the table:

$('#dg').datagrid({
   width: 355,
   height: 'auto',
   title: ' ',
   showHeader: false,
   rownumbers: false,
   fitColumns: false,
   striped: true,
   singleSelect: true,
   nowrap: false,
   collapsible:true,
   collapsed: true,
   columns:[[
      {field:'label',title:'Label',width:100},
      {field:'value',title:'Value',width:250}
   ]],
   onLoadError: function(XMLHttpRequest, textStatus, errorThrown){
              alert(JSON.stringify(XMLHttpRequest));
              alert(errorThrown);
        }
}).draggable();

any help will thank


Title: Re: datagrid + draggable
Post by: stworthy on December 06, 2014, 07:45:34 AM
The simplest way to drag a datagrid is to put the datagrid in a window or panel.
Code:
<div class="easyui-window" style="width:355px;height:300px">
  <table id="dg">
    ... 
  </table>
</div>


Title: Re: datagrid + draggable
Post by: catpaw on December 11, 2014, 10:33:54 AM
Im sorry

but is not what I need

the problem is that the datagrid is collapsed and collapsible:

collapsible:true,
collapsed: true,

I need to be able to move it when is collapsed and when not :/



Title: Re: datagrid + draggable
Post by: stworthy on December 11, 2014, 06:27:11 PM
If you want to drag the dialog by clicking and dragging on the titlebar, please try the following code.
Code:
$('#dg').datagrid({...});
var p = $('#dg').datagrid('getPanel');
p.panel('panel').draggable({
    handler:p.panel('header')
});


Title: Re: datagrid + draggable
Post by: catpaw on December 15, 2014, 09:13:54 AM
that works!!

thank you very much!!