BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
<script type="text/javascript">
$(function () {
$("#Grid").ejGrid({
// the datasource "window.gridData" is referred from jsondata.min.js
dataSource: window.gridData,
allowPaging: true,
allowGrouping: true,
allowRowDragAndDrop: true,
rowDrop: function (args) {
var dragRowIndex = args.rows[0].rowIndex; //get index of dragged row
var dropRowIndex = args.target.closest("tr")[0].rowIndex; //get index of dr row
var groupedColumns = this.model.groupSettings.groupedColumns; // grouped columnn
//var dataIndex =this.model.currentViewData.records.indexOf(args.data[0]);
// grouped column is shipCountry
// if you have multiple group columns , you need to loop thorugh it to get and set blow “value”
var value = this.model.currentViewData["records"][dropRowIndex]["ShipCountry"]; // get the value of group for the dropped row
this.model.currentViewData["records"][dragRowIndex ]["ShipCountry"] = value; //set that group value of the dragged row in the record list of currentViewData
this.refreshContent();
args.cancel = true;
},
groupSettings: { groupedColumns: ["ShipCountry"] },
columns: [
{ field: "OrderID", headerText: "Order ID", textAlign: ej.TextAlign.Right, width: 65 },
{ field: "CustomerID", headerText: "Customer ID", width: 90 },
{ field: "ShipCity", headerText: "Ship City", width: 90 },
{ field: "ShipCountry", headerText: "Ship Country", width: 90 },
{ field: "EmployeeID", headerText: "Employee ID", width: 90, textAlign: ej.TextAlign.Right }
]
});
});
</script>
|