Skip to content

how to provide the level-indented data in the dataprovider?? #7

Description

@robinclark007

with the recursive function ,
I can generate the array ,

[
 1 => 'root1',
 2 => '    root1 child1',
 3 => '    root1 child2',
 4 => 'root2',
 5 => '    root2 child1',
 6 => '    root2 child2',
]

but if I want to give the level indented data to the the activeDataProvider, it does't work.
anyway I can provide this kind of data to the ActiveDataProvider.
I don't think a simple sql statement can generate result like the array above.

$dataProvider = new ActiveDataProvider([
    'query' => Post::find(),
    'pagination' => [
        'pageSize' => 20,
    ],
]);
echo GridView::widget([
    'dataProvider' => $dataProvider,
]);

--test--

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions