Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hi,
I wanted to create a Up/Down functionality on grid as I can swap the ordering of rows in grid on clicking of button
can somebody please help me out how to create a service for this?
Thanks & Regards,
Khushboo jain,
Mestech Services Pvt Ltd
Solved! Go to Solution.
You could add a column that is the row number and then use that to move rows up and down.
selected data
sort by row number
show in grid
select grid row
hit up
selected grid row - row number into service
update grid row data
refresh data for grid
Truth be told this is incredibly inefficient but it will work
be nice to have this work client side and then a single update to the server when done.
an uglier way to do this,
get data
derivefields to add the index (or loop)
show in grid with index editable
edit grid index numbers
click update
You could add a column that is the row number and then use that to move rows up and down.
selected data
sort by row number
show in grid
select grid row
hit up
selected grid row - row number into service
update grid row data
refresh data for grid
Truth be told this is incredibly inefficient but it will work
be nice to have this work client side and then a single update to the server when done.
an uglier way to do this,
get data
derivefields to add the index (or loop)
show in grid with index editable
edit grid index numbers
click update
You could try with the "Grid Advanced" Widget.
It has tons of more features that the default Grid Widget - including sorting and filtering.
https://marketplace.ptc.com/apps/226764/grid-advanced---version-410#!overview
This might be easier than implementing it all on your own.
Cheers,
Michael
---
edit:
sorry - after reading again it seems like you're more interested in swapping the rows instead of just ordering them (ASC / DESC). Pai's answer has some good points on that :)
Hope you are doing good. Could you please confirm if the issue has been resolved.
If yes, please mark the answer as accept as solution for the future reference. Thank you in advance.
Regards-Mohit Goel