Author Topic: GUI text list help? [More Questions in New Post]  (Read 1682 times)

Hey guys, I've been working on a fairly large project lately

I need to know something

with GUI text list controls to add a row uses this format;
object.addrow(id, text, index)

I'm not sure what ID or Index is.

I'm assuming ID means it is the first, second, third, item in the list.

If this is so, that means I need to populate the list using a for loop so that I don't have all the entries with ID number 1, however for my purposes that isn't a way I can do it.

Is there a way to get the last item in the list's ID so I can add one then add the row?

Basically I need this to constantly be adding/removing rows, not just load the rows in at one point in time.  And if I use the same ID I assume it is going to overlap and just delete the old ID.  And creating a variable JUST to store the last created row ID is a bad way to do it if there is a way to just get the last ID

And what is Index?
« Last Edit: August 28, 2013, 08:57:22 PM by Vortex »

Not sure what ID is. But Index is what where you want the row to be added into the list. If you don't define this, then it will just add it to the bottom of the list.

index is what row it goes to.

id is a number that can be used to find a specific row, even when you sort differently. for example, the player list uses the object id of the client as the row id.


id is a number that can be used to find a specific row, even when you sort differently. for example, the player list uses the object id of the client as the row id.
Oh cool.

index is what row it goes to.

id is a number that can be used to find a specific row, even when you sort differently. for example, the player list uses the object id of the client as the row id.


very much appreciated

two questions:

how do I get the selected Index?  I can get the selected ID but not Index

And how do I sort?  I tried GUIName.sortList(row);
but it doesn't work, I tried the object name as well

list.getrownumbyid(list.getselectedid())


list.sort(column, direction)

list.getrownumbyid(list.getselectedid())


list.sort(column, direction)
direction being a bool?
the ID did work thanks and sort works but what should the direction parameter be

direction being a bool?
the ID did work thanks and sort works but what should the direction parameter be
Yes. Direction is a bool.
.sort(column ID, bool); If bool is true, sorts 0-Z. If bool is false, sorts Z-0.