Filter to view custom table data

Rita Mikusch asked on September 26, 2017 01:50

Hi,

I'd like to have an admin page where staff can easily view subsets of custom table data.

So instead of paging through 100 pages of data, a staff member can use a filter to only view the records where (for example) the data in Field-A = "hello world". Then staff can go through that filtered data and view records, edit records, or delete records.

In kentico 10, the custom table admin pages don't seem to offer that option. So maybe I need to create a custom module? Are there any other options?

Thank you!

Correct Answer

Peter Mogilnitski answered on September 27, 2017 14:27

Hold your horses... Here is how you do it: You need to create alternative form called "Filter" for you table - The name is important! There you define the fields that you want to be in your filter - you just mark them as Display field in the editing form. In the example below there is only one field in the form it is called ItemText:

Image Text

But now if you switch to the data tab:

Image Text P.S. you might need to click resest filter if you dont see any records

2 votesVote for this answer Unmark Correct answer

Recent Answers


Trevor Fayas answered on September 26, 2017 02:12

You can create a custom module interface and use the unigrid, documentation walks you through that.

May be able to clone the custom table user interface and simply pass it (in the user interface properties) a different unigrid xml path.

If you just need read on the data, you can use the report engine to create files reports using parameters SQL queries.

You may be able to generate in the SQL report the link that would edit the item as well (edit a table item, right click and view frame source to see the URL parameters and path)

You can also make a normal page with a query repeater and add filters.

I agree would be nice to have filters, I used custom module more and more because of that.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on September 26, 2017 03:28

I'd go the route of creating a report with input parameters. This way you can pretty much build your own setup without any custom code except building a query.

You could also create a custom webpart utilizing the unigrid control, add properties for a base "where condition" then set the columns to display filters automatically. Check out the unigrid definition on how to do this with an ascx control or using XML.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on September 27, 2017 14:37

You're correct Peter that's the most simple way to accomplish this. What I understood the OP wanted was to have these as preset filters already. If not, then your solution is the best, simplest and fastest approach.

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on September 27, 2017 15:14

I learned something today! Thanks Peter, had NO clue that you could do that :)

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on September 27, 2017 15:19

Here's the documentation regarding what Peter was talking about.

1 votesVote for this answer Mark as a Correct answer

Rita Mikusch answered on September 27, 2017 17:46

This is awesome, Peter, thank you! That's exactly what I was looking for.

I've seen that "alternative form" section, but had no idea it could do this.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.