Skip to main content

Notifications

Announcements

No record found.

Supply chain | Supply Chain Management, Commerce
Unanswered

How to use the emptyDataListTemplateId property on the IDataListState

Posted on by 1,433

I created a new view. I want to display a more accurate message when the itemDatasource is blank. Same as the CustomerDetailsView when there are no loyalty cards or nothing in the wishList.

My view has an HTML file, and then 2 TypeScript files, one for the vie and one for the ViewModel.

I saw in  "RetailSDK\POSWeb\Views\Customer\CustomerDetailsView\CustomerDetailsView.html" that it has a Script-tag with the ID "emptyWishListTemplate". Then it has a Div-tag with a data-bind and in here is the dataList with the property emptyDataListTemplate: 'emptyWishListTemplate'.

However my view doesn't have its dataList inside the HTML, its in the View.ts file . The HTML only has a Div-tag with a data-bind: data-bind="msPosDataList: dataListRelated"

I added below it the Script-tag with an ID, same as in the CustomerDetailsView.

However when I try to reference this id in the View.Ts file in the property of the DataList, it tells me it cannot find the template with that ID.

So where do I add the template so that it can be seen by the emptyDataListTemplateId property on the IDataListState?

My view also has 3 columns, each with its own list, similar as on the customerDetailsView. Currently I only get the standard "We didn't find anything to display here". I want to replace this with my custom message similar as the message on the CustomerDetailsView if there is nothing to display under the wishList tor the Loyalty cards for example.

CustomView.PNG

The customerDetailsView will show the following if there are no loyalty cards or a wish lisT:

CustomerDetailsView.PNG

Any help on how to accomplish the above with a new custom view that has an HTML-file, View and ViewModel files.

  • ToddB Profile Picture
    ToddB on at
    RE: How to use the emptyDataListTemplateId property on the IDataListState

    Hi Retha,

    I am going to leave this here for the community to reply, but am checking to see if I can find out anything around this.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans