cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1806
Views
2
Helpful
9
Replies

Sort column in 3rd party gadget

poonam.menon
Level 1
Level 1

Hi Team,

I have created a 3rd party gadget that displays the agent name , state and id. I need to sort each column in ascending and descending order.
Please help.

Thanks,

Poonam

1 Accepted Solution

Accepted Solutions

Hi Poonam,

Did you take a look at the Sort Table by Clicking the Headers section? When I clicked the Name column, the rows got sorted per the name column (and the country column also changed accordingly). When I clicked the Country column, the rows got sorted per country column and the name column changed accordingly.

You can add a plugin as long as it doesn't interfere with the existing jquery/desktop stuff.

Thanx,

Denise

View solution in original post

9 Replies 9

dekwan
Cisco Employee
Cisco Employee

Hi,

What are you using to display the agent name, state and id? Is it a HTML table? Take a look at this resource on how to sort tables: https://www.w3schools.com/howto/howto_js_sort_table.asp

Thanx,

Denise

Hi Denise,

I need to sort all the colums individually.Not just one column.I need to sort the table by agent name if the user clicks on agent name column.Similarly same functionality when the user clicks on agent state ,agent id etc.
Can we add any 3rd party plugin of jquery in finesse?

Thanks,

Hi Poonam,

Did you take a look at the Sort Table by Clicking the Headers section? When I clicked the Name column, the rows got sorted per the name column (and the country column also changed accordingly). When I clicked the Country column, the rows got sorted per country column and the name column changed accordingly.

You can add a plugin as long as it doesn't interfere with the existing jquery/desktop stuff.

Thanx,

Denise

Thank you Denise.It worked.

poonam.menon
Level 1
Level 1

Hi Denise,

The browser crashes when I am sorting the column .The table has about 600 records.The click is triggered correctly .But what I feel is that before the first sort is completed ,the user clicks on the next sort button .Once this has occured , the full site hangs.Is there any solution?
How can we  prevent the person from clicking on the sort until the data is loaded?
I have given the click events with off and on events.So, click is right I assume.
Please direct.

Hi,

The only thing I can think of is to remove the onclick for the other columns while one is being sorted. But the onclick will have to be added after the sort.

Thanx,

Denise

HI Denise,

I have given the click to the class in the header.and I have written it in on ,and off events.
How can we know if the sorting is done or not.?

Thanks,

Poonam

Hi Poonam,

The sorting is done when the sortTable function is complete. There isn't any handlers for it since it is triggered via the onClick handler. So maybe at the beginning of the sortTable function, you will remove the onClick of the other columns. Then at the end of the function, you add it back.

Thanx,

Denise

poonam.menon
Level 1
Level 1

Hi Denise,

Let me try that.
I was just thinking of giving a loader then the person clicks on the sort.Is there any loader available or we need to create a custom loader?

Thanks,