Hi Tri,
Grab the source code from the GitHub repository... you could easily add the create date by editing the html template. You may need to alter the controller as well, but I don't think so.
I'll try to post a more comprehensive reply a little later when I have time to devote to it.
Make sure you're including the createDate field (I have to check this) in your /config/ExamineIndex.config file.
Rebuild your index.
You should then be able to access the new field in the properties dictionary object on the member.
Of course, this is all theoretical until I can get to the project and try it out myself.
MemberListView is heavily dependent on the Examine index. If you don't have the createDate field (or whatever it should be - I'll have to look in the Umbraco source) in the index then you won't be able to retrieve it for display.
Now the dictionary key error has gone, but I couldn't make it to sort the list by create date, i change this field by create date in memberlistview.controller.js as well as in membersearch..
and also the createdate is not showing in the list view...
You'll need to do a fair bit more work to make sorting work with createDate including custom indexing the date so that it can be formatted. There are a few forum posts/blogs about this kind of thing.
Make sure that the createDate field is getting into your properties dictionary (you can inspect the network traffic as the list is being populated to see what the member data is looking like and use that knowledge to modify the memberlistview.html template.
One quick issue i found in the package is that, sorting in list using Email doesn't work too.
Received an error from the server
Failed to retrieve members
The given key was not present in the dictionary.
EXCEPTION DETAILS:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
STACKTRACE:
at System.Collections.Generic.Dictionary2.get_Item(TKey key)
at MemberListView.Helpers.MemberSearch.<>c__DisplayClass7.<PerformMemberSearch>b__4(SearchResult o)
at System.Linq.EnumerableSorter2.ComputeKeys(TElement[] elements, Int32 count)
at System.Linq.EnumerableSorter1.Sort(TElement[] elements, Int32 count)
at System.Linq.OrderedEnumerable1.
Add Member Creation Date in Member List View
Hello Robert,
How can I add member create date next to email in member list view. Would you mind helping me on that.
Thanks
Regards Tri.
Hi Tri, Grab the source code from the GitHub repository... you could easily add the create date by editing the html template. You may need to alter the controller as well, but I don't think so.
I'll try to post a more comprehensive reply a little later when I have time to devote to it.
Rob.
Hello Rob,
Thanks for the reply, I did add the code.. {{result.createDate}} in html and
.ForMember(member => member.CreateDate, expression => expression.MapFrom(result => result.Fields["createDate"])) in MemberItemMapper
and
[DataMember(Name = "CreateDate")] public string CreateDate { get; set; } in MemberListItem.cs
and rebuild the solution.. but was not working.. Something to do with the keyword.. createdate. It is showing error of not founding the key.
So, I did post this query.
Thanks
Regards
Tri
ok, so it's a little more complicated:
Of course, this is all theoretical until I can get to the project and try it out myself.
MemberListView is heavily dependent on the Examine index. If you don't have the createDate field (or whatever it should be - I'll have to look in the Umbraco source) in the index then you won't be able to retrieve it for display.
Hope this helps, Rob.
Hi Rob
I add the createDate, now it looks like
<IndexAttributeFields/>
Now the dictionary key error has gone, but I couldn't make it to sort the list by create date, i change this field by create date in memberlistview.controller.js as well as in membersearch..
and also the createdate is not showing in the list view...
Regards
Tri.
You'll need to do a fair bit more work to make sorting work with
createDate
including custom indexing the date so that it can be formatted. There are a few forum posts/blogs about this kind of thing.Make sure that the createDate field is getting into your properties dictionary (you can inspect the network traffic as the list is being populated to see what the member data is looking like and use that knowledge to modify the memberlistview.html template.
Hi Rob,
Thanks I will try that one.
Regards
Tri
Hi Rob,
One quick issue i found in the package is that, sorting in list using Email doesn't work too.
Received an error from the server Failed to retrieve members
The given key was not present in the dictionary.
EXCEPTION DETAILS:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. STACKTRACE:
at System.Collections.Generic.Dictionary
2.get_Item(TKey key) at MemberListView.Helpers.MemberSearch.<>c__DisplayClass7.<PerformMemberSearch>b__4(SearchResult o) at System.Linq.EnumerableSorter
2.ComputeKeys(TElement[] elements, Int32 count) at System.Linq.EnumerableSorter1.Sort(TElement[] elements, Int32 count) at System.Linq.OrderedEnumerable
1.is working on a reply...