|
<script type="text/javascript">
$(function () {
$("#Grid").ejGrid({
rowDragStart:rowDragStart,
allowRowDragAndDrop: true,
selectionType: "multiple",
columns: [
………………………………..
],
});
});
function rowDragStart(args) {
if (args.data[0].CustomerID == "VINET" || args.data[0].CustomerID=="VICTE") // cant move first and last stage
args.cancel=true;
}
</script>
|
| New | Hiring Manager | testing | 2 day(s) |
|
$("#Grid").ejGrid({
// the datasource "window.gridData" is referred from jsondata.min.js
dataSource: datamanager,
allowPaging: true,
allowRowDragAndDrop: true,
columns: [
{ field: "OrderID", headerText: "Order ID", isPrimaryKey: true, textAlign: ej.TextAlign.Right, width: 80 },
{ field: "CustomerID", headerText: "Customer ID", width: 100 },
{ field: "EmployeeID", headerText: "Employee ID", textAlign: ej.TextAlign.Right, width: 100, format: "{0:C}" },
{ field: "Freight", headerText: "Freight", width: 80 }
],
rowDragStart: "rowDragStart",
actionBegin:"drop"
});
});
function rowDragStart(args) {
if (args.data.CustomerID == "VINET" || args.data.CustomerID=="HILAA") // cant move first and last stage
args.cancel=true;
}
function drop(args){
if(args.dropDetails)
var value = args.dropDetails.DestinationRowIndex;
if(value == 0 || value == 9){
args.cancel = true;
}
} |