Hi,
I cannot define a template for my ListView items, since the "prop" parameter of my template-function is always empty, i.e. it does not contain the data of the current item to render.
I've attached an example (see the console.log(prop), line 16).
Thanks.
|
export const Template = () => {
const data = new DataManager({ json: emails, adaptor: new JsonAdaptor })
.executeLocal(new Query().take(15));
const template = props => {
console.log(props); /* "PROPS" IS ALWAYS EMPTY !!!! */
return (
<div className="e-list-wrapper e-list-multi-line email-sidebar-element">
<div className="mb-1">
<span className="fw-bold">{props.fromName}</span>
<span className="float-end">
<ButtonComponent
cssClass="e-small e-outline border-0"
iconCss="las la-trash"
tooltip={'Delete'}
/>
</span>
</div>
<div className="mb-1">
<span>{props.subject}</span>
<span>{props.date?.toString()}</span>
</div>
<div>
<p>{props.text}</p>
</div>
</div>
);
}; |
Ok, works, thanky ou.
However, I do not understand why the original line for the DataManager is not working for the listView in this way too, since for the GridComponent for example it works in that way?
I'm referring to the following line:
const data = new DataManager({ json: emails, adaptor: new JsonAdaptor });
Using this code line as datasource in a GridComponent for example does not give any problem, only in the ListView I have to add the executeLocal()-call... Why?