Forum Discussion
Can DetailList component do this?
Thanls Beau Cameron for the clarification.
I am afraid that the filter functionallity OOB is not what I am looking for.
In my web part I have a group of buttons, some of them re render the DetailList and show the results in groups, and some other buttons should filter the list when they get clicked. I have created the list's views to see how it should work, now I am stuck in getting the same funciontalliy in the Detailist.
In the list it is a column that shows agreements end dates and I have a listview that show only the rows which it date is older than today.
In the detailList filter I can't find the way to do that type of filtering,
I don't even find the way to conect the button's click event to the DetailList in order to filter the list.
Best regards,
Americo
Americo Perez Maybe I'm not fully understanding, but you have a lot of control in how your data is filtered. That details list is just a rendering of your items. Your button isn't directly connected to your DetailList. Your DetailList should be getting the items from the state of your component. Your button that is doing some filtering, should have the click event, which would subsequently filter/sort/change the state object for your items.
Your event could filter the *current* list of items in your state, or you could make a new call to SP to get a new list of items. Either way, you just need to set your state based on that criteria. If in your case, you want to filter by today's date... you'd write the JS to filter out the current list and set the state, or make a call to SharePoint to get new items filtered by the date.