ThinkFloyd
ThinkFloyd

Reputation: 5021

Issue with Nested List when data does not contain 'text' node

I want to render Nested list such that when I drill down back button shows name of parent node. I tried it but looks like if the JSON I am getting doesn't have node with name text, it won't work.

Here is the fiddle with local data (in my app I am using store to fetch this from service so I don't have control over name of nodes)

Please note back button where title is not populated when you go down the tree.

Upvotes: 0

Views: 130

Answers (1)

SachinGutte
SachinGutte

Reputation: 7055

There is this displayField config of NestedList where you can specify which field to be used to set title and item text . By default it is set to text but you can specify it to be one of your model field.

Here's working fiddle based on your example. Only change is in config of NestedList at bottom.

But, if you are overriding getItemTextTpl or getTitleTextTpl, this config will be ignored.

Upvotes: 1

Related Questions