|
<script>
angular.module("GridCtrl", ["ejangular"])
.controller("bodyCtrl", function ($scope) {
//Provide the second Grid datasource in the initial rendering.
$scope.data = ej.DataManager({json: obj,
batchUrl: "BatchUpdate",
adaptor: new ej.remoteSaveAdaptor()
});
$scope.DetailGridLoad = function (args) { // rowSelected event
---
var detaildata = dataManager.executeQuery(query).done(function (e) {
$scope.data = ej.DataManager({url: e.result,
batchUrl: "BatchUpdate",
adaptor: new ej.remoteSaveAdaptor()
});
//bind the second Grid data source while updating
}
});
----
});
</script>
|
|
<script>
angular.module("GridCtrl", ["ejangular"])
.controller("bodyCtrl", function ($scope) {
//Provide the second Grid datasource in the initial rendering.
$scope.data = ej.DataManager({
url: "/api/Employee",
batchUrl: "/api/batch",
updateUrl: "/Grid/UrlUpdate",
insertUrl: "/Grid/UrlInsert",
removeUrl: "/Grid/UrlDelete",
adaptor: new ej.WebApiAdaptor(),
});
$scope.DetailGridLoad = function (args) { // rowSelected event
---
var employeeID = args.data.EmployeeID;
var query = ej.Query().where("EmployeeID", ej.FilterOperators.equal, employeeID, false);
grid.option("query", query);
var dataManager = ej.DataManager({
url: "/api/Employee",
batchUrl: "/api/batch",
updateUrl: "/Grid/UrlUpdate",
insertUrl: "/Grid/UrlInsert",
removeUrl: "/Grid/UrlDelete",
adaptor: new ej.WebApiAdaptor(),
});
grid.dataSource(dataManager) //bind the second Grid data source with adaptor enabled
}
});
----
});
</script>
|
|
<div class="content-container-fluid">
<div class="row">
<div class="cols-sample-area">
<div class="label1">Master Grid </div>
<div id="MasterGrid" ej-grid e-datasource="empData" e-allowselection='true' e-rowselected="DetailGridLoad">
<div e-columns>
----
</div>
</div>
<div class="label1">Detail Grid</div>
<div id="DetailGrid" ej-grid e-datasource="data" e-allowpaging="false" e-editsettings="editSettings" e-toolbarsettings="toolbarItems">
<div e-columns>
----
</div>
</div>
</div>
</div>
</div>
<script>
angular.module('listCtrl', ['ejangular'])
.controller('PhoneListCtrl', function ($scope) {
---
//Provide the second Grid datasource in the initial rendering.
$scope.data = ej.DataManager({
url: "/api/Employee",
batchUrl: "/api/batch",
updateUrl: "/Grid/UrlUpdate",
insertUrl: "/Grid/UrlInsert",
removeUrl: "/Grid/UrlDelete",
adaptor: new ej.WebApiAdaptor(),
});
$scope.DetailGridLoad = function (args) { // rowSelected event for first Grid
var employeeID = args.data.EmployeeID;
var query = ej.Query().where("EmployeeID", ej.FilterOperators.equal, employeeID,false);
$('#DetailGrid).ejGrid('instance').option({query: query}); // Apply the Grid query in setmodel
$scope.data = ej.DataManager({
url: "/api/Employee",
batchUrl: "/api/batch",
updateUrl: "/Grid/UrlUpdate",
insertUrl: "/Grid/UrlInsert",
removeUrl: "/Grid/UrlDelete",
adaptor: new ej.WebApiAdaptor(),
}); //bind the second Grid data source with adaptor enabled
---
}
});
</script>
|