EasyUI Forum
May 14, 2024, 07:42:18 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: datagrid + draggable  (Read 9831 times)
catpaw
Jr. Member
**
Posts: 85


View Profile Email
« 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
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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>
Logged
catpaw
Jr. Member
**
Posts: 85


View Profile Email
« Reply #2 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 :/

Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 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')
});
Logged
catpaw
Jr. Member
**
Posts: 85


View Profile Email
« Reply #4 on: December 15, 2014, 09:13:54 AM »

that works!!

thank you very much!!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!