How i add progress bar in serenity is core? #6778
Replies: 2 comments 21 replies
-
Well, I'm not 100% sure what you are trying to accomplish -- a picture would help -- and this is the kind of thing that is probably easiest to do in a report. But here is a suggestion. I will be using the Employees table in Northwind to represent the Companies in your Campaign. For the purpose of this example, let's say that the Campaign Goal is 10000. We will use the Extension value for each Employee as the progress towards that goal. We will use the Employee's Last Name as the Company: ... so, for this example, we can get a percentage-towards-goal for each row like this: ... we can get a number of blocks in the progress bar like this:
.. and we can get a progress bar using a unicode block character, based on that percentage, like this or similar: `replicate(nchar(9608), ceiling(((Extension/10000.00 )* 100 )/5)) as Blocks ... so now we can make Blocks a column in our *Row.cs, like this:
... and the result will look like this (I include the extension for each employee so you can see that the expression for progress is working as expected). It looks pretty good and is even sortable: You can further prettify this by using the *Grid.ts Maybe this will help -- if not, be a little clearer on what you are trying to do in your response, and maybe somebody will have a different idea to help you! Again, an annotated image would probably help give us the idea. It's possible, for example, that you are just trying to create ONE vertical bar (like a thermometer) representing how much money you have collected towards a goal or how many companies out of a total number of companies have participated. Vertical is a little harder than what I showed you, but possible. And obviously, if you only one ONE horizontal bar on the page, representing overall progress rather than per-row progress, you can use a variation on the trick I just showed you. |
Beta Was this translation helpful? Give feedback.
-
@sapster77 sorry I didn't mean you should literally put in "as int?". Notice that part wasn't all in code format! I was just making sure you knew what the data type should be for this example data, because I wasn't putting all the lines in for declaring this new column in the row. The full instruction for the new column should look like the Id column in the same LanguageRow.cs file; in other words:
... followed further down in the same file by this (again, similar to Id):
Does that make more sense? Sorry I was a bit lazy before! Anyway doing this "vanilla" test maybe gets us closer to what is wrong. And btw I don't think you are "stubborn"; it is good to understand how things work. I personally don't like the idea that anything in software is "weird"; there is always an answer, and we should not give up. (Even though I still like the idea of my alternative solution, which comes from years of having to do stuff like this in reporting environments, fyi.) I think the fact that you had to move the "format" import is a clue, because these things move around in different versions of Serenity framework code. So, there is something different in your generate/build processing than ours. So, let me ask you this: My generated ServerTypes\Administration\LanguageColumns.ts file has these lines:
and
Does your file have these lines? Note: I am not suggesting that you hand-edit the generated file. We just want to know if for some reason your generate/build processing isn't picking up on your formatter. |
Beta Was this translation helpful? Give feedback.
-
I have a page where I define a campaign. I want to follow how far they have progressed by listing the companies participating in the campaign. How can I add Progress Bar, I couldn't find any source. I'll be happy if you can help me.
What I want to do is to add the company name in the list and a progress bar next to it.
Beta Was this translation helpful? Give feedback.
All reactions