0

I have an ng-grid like:

$scope.Users = [
    { userID: '1', userName: 'Kan' },
    { userID: '2', userName: 'Kumar' }
];

$scope.userGrid = {
    data: 'Users',
    plugins: [new ngGridFlexibleHeightPlugin()],
    showFooter: true,
    columnDefs: [
        { field: 'userID', displayName: 'UserID' },
        { field: 'userName', displayName: 'UserName' }
    ]
};

Now I want to create another ng-grid from my rendered grid. Is it possible?

Amin Uddin
  • 968
  • 6
  • 15
  • 31
  • Look at my lengthy answer here: http://stackoverflow.com/questions/24008491/nested-ng-grids/24010739#24010739 – mainguy Jun 19 '14 at 10:02
  • Thanks. But I do not want nested grid. I just copy the object obj such grid to create another grid. But how? – Amin Uddin Jun 19 '14 at 10:58
  • You mean like this? http://plnkr.co/edit/lDSjjHA9SLczHiMgQtQb?p=preview or in different Controllers? – mainguy Jun 20 '14 at 10:09
  • Thanks. Your concept is similar to mine. But I want create it dynamically with plugin. In plugin I have such grid but how do I create another from it. In plugin I just need such grid definition without data. – Amin Uddin Jun 21 '14 at 02:56
  • Hmm, I still don't get what you want. Last suggestion is not my concept, it's how angular works. You don't copy anything in the DOM. Maybe you are talking about a global configuration? Look here: http://stackoverflow.com/questions/23630928/angular-js-ng-grid-default-global-configurations/23650650#23650650 – mainguy Jun 21 '14 at 08:58
  • Thanks, Is there any way to get definition of a grid? – Amin Uddin Jun 21 '14 at 09:19

0 Answers0