angular-data-grid / angular-data-grid.github.io

Light and flexible Data Grid for AngularJS applications.
http://angular-data-grid.github.io/demo/bootstrap/
112 stars 50 forks source link

Multiple Grids Data problem from database. #22

Open Bilalriazwork opened 7 years ago

Bilalriazwork commented 7 years ago

I set Multiple Grids in my code successfully. butt your example with static data. i try different ways to get dynamic data from database. butt it's not work. Please help me in this case. how i can get data in multiple grids from database. in case of single data is working proper.

AlexanderZhukCoherent commented 7 years ago

@Bilalriazwork can you please provide codepen / plunker / jsfiddle / code archive to let us reproduce the issue? thanks.

Bilalriazwork commented 7 years ago

@AlexanderZhukCoherent Thanks You Reply. I have successfully resolved this issue. I will send you sample code in working days. Thanks. butt i face little bit other issues. can i discuss with you frequently !!

AlexanderZhukCoherent commented 7 years ago

@Bilalriazwork Sure, please share your findings

Bilalriazwork commented 7 years ago
function CollectionGrid() {

    $scope.gridOptionsPC = {
        data: []
    };
    $scope.gridActionsPC = {};
    $http({
        method: "POST",
        url: "/DashBoards/LoadCollectionGrid",
        dataType: 'json',
        headers: { "Content-Type": "application/json" },
        params: {
            dtDate: PCDate,
            dtTo: PCToDate,
            Type: PCtype
        }
    }).then(function successCallback1(response) {

        $scope.refresh = true;
        $timeout(function () {
            $scope.refresh = false;
        }, 0);            
        $scope.gridOptionsPC.data = angular.fromJson(response.data);
    });
}
Bilalriazwork commented 7 years ago

I used This method.

Naveen-ASI commented 7 years ago

for me this method not working

Bilalriazwork commented 7 years ago

you can follow this in View. < div ng-if="!refresh" grid-data id='gridMasterPC' grid-options="gridOptionsPC" grid-actions="gridActionsPC" > and also create $timeout object on top of angularjs

AnishLushte07 commented 7 years ago

@AlexanderZhukCoherent @Bilalriazwork Hi, How did you resolved issue pagination and sorting if data is coming from server in multi grid. I even tried with two separate controllers for two tables but problem still persists.

Bilalriazwork commented 7 years ago

Hi @AnishLushte07 you will just remove this code "urlSync: true", Pagination and sorting will work. you was no need to call two controllers.