Classic list view provides information on the list schema through ctx.ListSchema, is there any for SPFx. I tried almost all objects in SPFx ListViewCommandSet and they are null or empty. Is there way to get view columns, and field type without making additional REST APIs?
1 Answer
You can try windows.g_listData
variable. But information there is not always correct. Here is a question regarding g_listData
https://github.com/SharePoint/sp-dev-docs/issues/1243
Another way is to call RenderListDataAsStream
endpoint which will return all the information about the list and view. You can learn more about it here, here, or just open Network in Developer Tools and see what's happening when you're changing the view or scrolling down in modern list.