Show the count within the button caption for pre defined searchBuilder

Show the count within the button caption for pre defined searchBuilder

cj1005cj1005 Posts: 142Questions: 45Answers: 1

Hi,

To explain my question, it is easier to explain what I'm trying to achieve:

I have a datatable, showing a list of active\non active vehicles, I have set up some buttons that perform predefined searches using the searchBuilder extension, currently, the buttons have their captions set as 'Current Vehicles' or 'Discontinued Vehicles' but would what be really useful is to show the number of vehicles within each of the button captions 'Current Vehicles (1054)' or 'Discontinued Vehicles (27)'.

I'm thinking I would need to save the current searchBuilder details, then perform each pre-defined search (without updating the datatable visually) getting the total count for each pre-defined search, which is then used to update the related button's caption, and then reset the searchBuilder to the initial seachBuilder details.

Is this possible & if so could you kindly point me in the right direction?

Test page: here
Login details: DTUSERS
(Same for un & ps)
Click on 'Car List' from the side menu.

Any advice greatly appreciated!

Cheers, Chris

This question has an accepted answers - jump to answer

Answers

  • sandysandy Posts: 913Questions: 0Answers: 236
    Answer ✓

    Hi @cj1005 ,

    What you have suggested here will work fine. I've put together a small example here. You can add the code to events as well where the data may change the number that should be displayed.

    Hope this helps,
    Sandy

  • cj1005cj1005 Posts: 142Questions: 45Answers: 1

    Thank you Sandy :smile:

Sign In or Register to comment.