Open razyalov opened 4 years ago
I also have a data source being updated and the grid is not being refreshed
@ObservedObject var viewModel: ViewModel
var body: some View {
QGrid(
viewModel.attachments,
columns: horizontalSizeClass == .compact ? 2 : 3,
vSpacing: 24,
hSpacing: 16,
vPadding: 16,
hPadding: 16
) {
AttachmentButton(
viewModel: AttachmentViewModel(attachment: $0)
)
}
.onAppear(perform: viewModel.load)
.navigationBarTitle("Attachments")
}
Replacing QGrid with List works, but not the desired layout.
I am also facing exactly the same issue!!
QGrid
Did you figure out a way out for this issue?
Ended up writing my own version from scratch.
On Aug 16, 2020, at 4:06 AM, amrit42087 notifications@github.com wrote:
QGrid
Did you figure out a way out for this issue?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Ended up writing my own version from scratch. … On Aug 16, 2020, at 4:06 AM, amrit42087 @.***> wrote: QGrid Did you figure out a way out for this issue? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Thanks for replying. Even I had to create my own solution. But mine is not generic. I have to create a grid for every type of data. Is it possible for you to share the approach you followed?
Very similar to the QGrid source code just without all the configuration options. I divide my list into rows and add them into a vstack of hstacks inside a parent scroll view.
On Aug 16, 2020, at 9:22 AM, amrit42087 notifications@github.com wrote:
Ended up writing my own version from scratch. … On Aug 16, 2020, at 4:06 AM, amrit42087 @.***> wrote: QGrid Did you figure out a way out for this issue? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Thanks for replying. Even I had to create my own solution. But mine is not generic. I have to create a grid for every type of data. Is it possible for you to share the approach you followed?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
I have the
QGrid
setup to render a list of objects that are converted to views inside theQGrid
’s block. When my API fetches updated data the view is rebuilt. I confirmed that theQGrid
is called again, yet, it keeps rendering the initial list of views and not the newly created views. If I switch toList
it works properly. Only withQGrid
it doesn’t refresh. Here is the code in question:Any ideas as to what I might be doing wrong?