Nested Lists in Model with item template
- Whether you need to access the data declared inside the nested list items from the ListView template?
- In your code snippet, you have rendered “WebFpListView” and “ItemContentTemplate”. Whether it was your own custom component?
Hello Kanagambigai,
thanks for your reply. Answer to your questions:
- Whether you need to access the data declared inside the nested list items from the ListView template?
The component specified as ItemTemplate needs to access the List<PlcVariableVM> of the given PlcDeviceVM.
<PlcDisplay Width="300px" Device="@plcDevice" />
Component Code:
PlcDisplay
https://pastebin.com/fYuPRHL3
PlcVariableDisplay
https://pastebin.com/mANztnL4
PlcDeviceVM class has the mentioned List<PlcVariableVM>
https://pastebin.com/syRAqqDx
The WebFpListView is my Blazor component, which uses your EjsListView. It's kind of a wrapper with some custom logic and parameters.
It is possible to specify an RenderFragment<TData> ItemContentTemplate there. If it is defined, it is used as ItemTemplate for the EjsListView. Otherwise the data is output as string value. For the ItemContentTemplate, another component I wrote is used.
So basically im giving the EjsListView a List<Model>, which has a nested List<AnotherModel> for the Template I use in the EjsListView. Is there a problem with specfing such a List<Model> and giving it as DataSource to an EjsListView, then specifing an item template to render the content of the nested List?
Thank you very much for your help.
Best Regards,
Karl Posch
- 3 Replies
- 3 Participants
-
KP Karl Posch
- Sep 2, 2019 11:17 AM UTC
- Sep 4, 2019 09:33 AM UTC