DnD Archives | phpGrid - PHP Datagrid Create PHP grids in minutes, not hours. Fri, 29 Nov 2024 23:56:04 +0000 en-US hourly 1 CodeProjecthttps://wordpress.org/?v=7.0.3 129966043 enable_dnd_grouping() https://phpgrid.com/documentation/enable_dnd_grouping/ Thu, 21 Nov 2019 19:33:16 +0000 http://phpgrid.com/?p=9556 * Please note this feature is only available in commercial licenses. Parameter(s): $dnd_grouping: boolean to enable/disable drag and drop grouping Description: Enable on the fly drag and drop grouping Example: 1$dg -> enable_dnd_grouping(true);

The post enable_dnd_grouping() appeared first on phpGrid - PHP Datagrid.

]]>
* Please note this feature is only available in commercial licenses.

  • Parameter(s):
    • $dnd_grouping: boolean to enable/disable drag and drop grouping
  • Description:
    • Enable on the fly drag and drop grouping
  • Example:
1
$dg -> enable_dnd_grouping(true);

The post enable_dnd_grouping() appeared first on phpGrid - PHP Datagrid.

]]>
9556
Drag & Drop Rows Between Grids https://phpgrid.com/example/drag-drop-rows-grids/ Wed, 22 Mar 2017 06:58:32 +0000 http://phpgrid.com/?p=9270 You can drag and drop rows between two or more grids using a mouse. In the demo, we have both orders and employees datagrids on the same page. 123456use phpCtrl\C_DataGrid; require_once("/file/path/to/conf.php");   $dg = new C_DataGrid("select * from employees", "employeeNumber", "employees"); $dg->enable_edit("FORM", "CRUD"); $dg->display(); We add the following Javascript to enable drag and drop between […]

The post Drag & Drop Rows Between Grids appeared first on phpGrid - PHP Datagrid.

]]>
dnd-phpgrid

You can drag and drop rows between two or more grids using a mouse.

In the demo, we have both orders and employees datagrids on the same page.

1
2
3
4
5
6
use phpCtrl\C_DataGrid;
require_once("/file/path/to/conf.php");  

$dg = new C_DataGrid("select * from employees", "employeeNumber", "employees");
$dg->enable_edit("FORM", "CRUD");
$dg->display();

We add the following Javascript to enable drag and drop between the two php grids.

The Ondrop event posts the row data to another url “save_dropped_row.php”. You must implement this server side script to handle how you would like the row data to be saved.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<script>
$(function(){
  jQuery("#orders").jqGrid("sortableRows", {});
  jQuery("#employees").jqGrid("sortableRows", {});

  jQuery("#orders").jqGrid('gridDnD',{
    connectWith:'#employees',
    drop_opts:{
      hoverClass: "ui-state-active",
    },
    ondrop: function(evt, obj, data){
      $.ajax({
          method: "POST",
          url: "save_dropped_row.php",
          data: data,
        }).done(function( msg ) {
            console.log( "Data Saved: " + msg );
        })
    },

  });  
})
</script>

Complete Drag and drog API documentation can be found on jQuery UI draggable and droppable widgets.

Run Live Demo!

The post Drag & Drop Rows Between Grids appeared first on phpGrid - PHP Datagrid.

]]>
9270