Sounds nice. I'm thinking that if you put the option to have the scrollbar inside and the title inside, we have something that might be another Tablet replacement.
The question is, do we need two libraries? Also, do you plan to evolve this up to the point where it would be a replacement for TableTopLib?
I'm probably going to remove the frame texture and let whoever creates a scrollingtable set the look and feel.
The way it looks default is how I embed it into my dkp mod. If you place the table on a shaded frame, the scrollbar looks alot better.
If it's a huge issue, create a ticket.
I can't answer your question, as I'm not sure what TableTopLib did.
What I can tell you is that with this lib you can create a table that will:
Sort columns up/down
Color column background
Color row text by value or function
Color column text by value or function
Color cell text by value or function
display cell value be value or function...
it's ridiculously configurable. I plan to write up documentation on the project page soon, I'm integrating it into my dkp mod right now... when I'm done i'll have code samples and whatnot.
I'm probably going to remove the frame texture and let whoever creates a scrollingtable set the look and feel.
The way it looks default is how I embed it into my dkp mod. If you place the table on a shaded frame, the scrollbar looks alot better.
If it's a huge issue, create a ticket.
I can't answer your question, as I'm not sure what TableTopLib did.
What I can tell you is that with this lib you can create a table that will:
Sort columns up/down
Color column background
Color row text by value or function
Color column text by value or function
Color cell text by value or function
display cell value be value or function...
it's ridiculously configurable. I plan to write up documentation on the project page soon, I'm integrating it into my dkp mod right now... when I'm done i'll have code samples and whatnot.
That sounds great. Will the sort be functions that can be attach to the columns? That, if I click on level, I'll be able to use a sort that sort first on level and then on name for example.
TableTop also did variable length columns. You could click on the line separating the column in the header and make them grow or shrink. I believe you could also change the order of the columns dynamically. There was also a format when the rows would be group with headers (a bit like you have in the tradeskill windows). If you want to see it in action, download Sanity2 and SanityInventoryCache. It will show it to you in action.
for instance. if you want a color of a cell to be green if the value is 66-100, yellow if the value is 33-66, and red if the color is 0-33, then you can specify a function as the color, and it will evaluate what color to use based on the output of the function.
so you would define a function and set it to the value of the color, the mod does the rest. if you need arguments passed to the function, you can set them to colorargs, and the mod applies the args to the color function when called.
functions for cell data values work the same way.
I do not have any plans for variable width columns... but I don't think it would impossible to do... actually it might be really easy... but I have other priorities at the moment.
I have an idea for specifying alternate sort so you can sort by more than 1 column... I had it working in my dkp mod before i made this widget... and I hope to be able to address it soon.
That sounds great. Will the sort be functions that can be attach to the columns?
You can now specify what column to sort next when sorting a particular column. You can use this technique to scroll as many columns as you have but be careful not to overlap the "sort chain" because there's a good chance you can throw yourself in an infinite loop.
Well, I guess. Only if you want the icon to be clickable and not the cell. Just asking because I would not want you to go to that trouble for something that is might not really needed but if you know you will use it... :-)
I'm hoping to replace the other scrolling table in my addon (it currently uses 2)
But the second table has 2 button columns that show who is going to get attendance and dkp for the night's raid.
I made custom textures for them that show a green A for attendance if they get it, and a red A if they dont. Clicking it toggles the value.
Everything seems doable except i'm still trying to figure out how to get the highlight texture of the row to highlight over the button for the icon. I assume i have to use a button, I don't think I can trigger click events on a texture.... Can I grab coords of the click from the row's onlclcik? all things i must research.
I'm hoping to replace the other scrolling table in my addon (it currently uses 2)
But the second table has 2 button columns that show who is going to get attendance and dkp for the night's raid.
I made custom textures for them that show a green A for attendance if they get it, and a red A if they dont. Clicking it toggles the value.
Everything seems doable except i'm still trying to figure out how to get the highlight texture of the row to highlight over the button for the icon. I assume i have to use a button, I don't think I can trigger click events on a texture.... Can I grab coords of the click from the row's onlclcik? all things i must research.
btw, are you using this library?
No yet, I plan to but I have other UI redesign to do before getting to the scroll lists parts. I've very interested so that's why I follow what you are doing :-).
I was having issues with doing scrolling tables of my own, which in turn was limited my drive to actually code anything. This little library solves all the headaches, thanks for that.
I'm building a DKP mod as well, and I needed a table that could handle selection, at least single select. I have added that into my copy of the library.
I was wondering if you would be interested in implementing that feature into the base library? I'd be glad to offer the code changes I have.
It's a simple addition, and I imagine just adding an additional flag to the CreateST function you could toggle it on and off easily.
What I did basically was:
Changed the Row from a frame to a button.
Gave each row an ID and an Onclick
In each onclick it checks a variable in the scrolling table, I called it selected. When you click it puts a table into selected ["id"] is the row's ID, ["data"] is the data row. Now that I think about it, it might have issues with a sorted grid, but that shouldnt be a hard fix.
As well as refresh will toggle LockHighlight() or UnlockHighlight().
There might be some glaring holes in my code, I haven't tested in that extensively as once I got it working I had a raid to run to.
Anyway, thanks again for making my life a thousand times easier.
this looks cool. any thoughts about how you might handle collapsible groups? i would think of the file browser paradigm as the basis for the operation. calls into question some sorting aspects (what do groups provide in terms of the different table information?)
At this time, I have no plans for collapsible sections.
I'm not 100% sure, but in order to do that i'd need a different architecture.
This is more a utility for creating scrolling tables fast, while letting you muck around with the data and have it update live.
it would be nice if a resize of the st would increase/decrease the number of rows accordingly.
for columns and resizing, maybe you could do a "min/max" width system. give each column a min/max width component (no specification means min and max are equal to the normal width). any horizontal resizing of the st would filter back thru the columns such that each column that is larger than its min size would shrink and each column that is smaller than its max size would grow, as needed and probably proportionally.
this would let you set up any particular column to accept the entirety of any new space allocated in a resize up, or you could split it between any number of rows.
but so far, i'm playing around with it and it's a pretty nice little library.
I've been thinking about draggable column widths and what I would do in the case of resizing the table width wise is let you specify 1 column with a dynamic width. That would be, by far, the easiest and least destructive method of implementing it.
Showing more rows for vertical resizing also seems doable.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'd appreciate comments...
I plan to have some documentation up soon... and a few more features implemented hopefully :)
The question is, do we need two libraries? Also, do you plan to evolve this up to the point where it would be a replacement for TableTopLib?
The way it looks default is how I embed it into my dkp mod. If you place the table on a shaded frame, the scrollbar looks alot better.
If it's a huge issue, create a ticket.
I can't answer your question, as I'm not sure what TableTopLib did.
What I can tell you is that with this lib you can create a table that will:
Sort columns up/down
Color column background
Color row text by value or function
Color column text by value or function
Color cell text by value or function
display cell value be value or function...
it's ridiculously configurable. I plan to write up documentation on the project page soon, I'm integrating it into my dkp mod right now... when I'm done i'll have code samples and whatnot.
That sounds great. Will the sort be functions that can be attach to the columns? That, if I click on level, I'll be able to use a sort that sort first on level and then on name for example.
TableTop also did variable length columns. You could click on the line separating the column in the header and make them grow or shrink. I believe you could also change the order of the columns dynamically. There was also a format when the rows would be group with headers (a bit like you have in the tradeskill windows). If you want to see it in action, download Sanity2 and SanityInventoryCache. It will show it to you in action.
so you would define a function and set it to the value of the color, the mod does the rest. if you need arguments passed to the function, you can set them to colorargs, and the mod applies the args to the color function when called.
functions for cell data values work the same way.
I do not have any plans for variable width columns... but I don't think it would impossible to do... actually it might be really easy... but I have other priorities at the moment.
I have an idea for specifying alternate sort so you can sort by more than 1 column... I had it working in my dkp mod before i made this widget... and I hope to be able to address it soon.
You can now specify what column to sort next when sorting a particular column. You can use this technique to scroll as many columns as you have but be careful not to overlap the "sort chain" because there's a good chance you can throw yourself in an infinite loop.
Edit: post comments here if you have any ideas on the topic
http://www.wowace.com/projects/lib-st/tickets/2-icons-in-table/
Do you have something in mind that cannot be done by using |t to embed graphic in the text?
Well, I guess. Only if you want the icon to be clickable and not the cell. Just asking because I would not want you to go to that trouble for something that is might not really needed but if you know you will use it... :-)
But the second table has 2 button columns that show who is going to get attendance and dkp for the night's raid.
I made custom textures for them that show a green A for attendance if they get it, and a red A if they dont. Clicking it toggles the value.
Everything seems doable except i'm still trying to figure out how to get the highlight texture of the row to highlight over the button for the icon. I assume i have to use a button, I don't think I can trigger click events on a texture.... Can I grab coords of the click from the row's onlclcik? all things i must research.
btw, are you using this library?
No yet, I plan to but I have other UI redesign to do before getting to the scroll lists parts. I've very interested so that's why I follow what you are doing :-).
I'm building a DKP mod as well, and I needed a table that could handle selection, at least single select. I have added that into my copy of the library.
I was wondering if you would be interested in implementing that feature into the base library? I'd be glad to offer the code changes I have.
It's a simple addition, and I imagine just adding an additional flag to the CreateST function you could toggle it on and off easily.
What I did basically was:
Changed the Row from a frame to a button.
Gave each row an ID and an Onclick
In each onclick it checks a variable in the scrolling table, I called it selected. When you click it puts a table into selected ["id"] is the row's ID, ["data"] is the data row. Now that I think about it, it might have issues with a sorted grid, but that shouldnt be a hard fix.
As well as refresh will toggle LockHighlight() or UnlockHighlight().
There might be some glaring holes in my code, I haven't tested in that extensively as once I got it working I had a raid to run to.
Anyway, thanks again for making my life a thousand times easier.
I'm currently investigating onclick for the row for other reasons. But I may be able to come up with something that suits both of our needs...
I'm not 100% sure, but in order to do that i'd need a different architecture.
This is more a utility for creating scrolling tables fast, while letting you muck around with the data and have it update live.
for columns and resizing, maybe you could do a "min/max" width system. give each column a min/max width component (no specification means min and max are equal to the normal width). any horizontal resizing of the st would filter back thru the columns such that each column that is larger than its min size would shrink and each column that is smaller than its max size would grow, as needed and probably proportionally.
this would let you set up any particular column to accept the entirety of any new space allocated in a resize up, or you could split it between any number of rows.
but so far, i'm playing around with it and it's a pretty nice little library.
Showing more rows for vertical resizing also seems doable.