Jump to content
UBot Underground

Sorting Datagrid By Integer Value


Recommended Posts

I've tried several plugins/options (aymens datagrid UI, Ustrap, and Ultimate UI) but still can't seem to figure out the right way to do this:

 

I have a table with a number of columns, some of which have Integer values I'd like users to be able to sort by (highest to lowest or vice versa). Then right click a row and have it pull data from a column in that row to run a function.

 

Aymens seems closest to matching the needs as it sorts, but it always reports the wrong value properly - when getting the cell value for that row it seems to pull the data from before when the datagrid was sorted, so it's pulling the wrong data to work with.

 

Is there a way to force aymens datagrid ui to update behind the scenes to pull the correct row data? I would prefer to use Ultimate UI but I haven't found a way to get it to sort by column value yet and I may have missed something with sorting there - same with Ustrap tables.

 

Would anyone be willing to post a super simple code snippet to get sorting and right-clicking to pull data from the correct row/cell for a function call?

 

I would be eternally grateful, I've been trying various approaches for a while now and pulling my hair out as I have a deadline for a project coming up.

 

Thanks in advance for any help.

Link to post
Share on other sites

save the table to sqlite, make a button for "sort"

then call sqlite table with query sort by x
 

SELECT
*
FROM
    table
order by x desc;

set ubot table to ustrap table variable

-------------------

or sort table in ubot
https://wiki.ubotstudio.com/wiki/Sort_Table

then set to ustrap variable

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...