I have the following haml code:
- #theLinks.each_index do |x|
%br
%form{:action=>'/Download', :method=>"post",:enctype=>"multipart/form-data"}
%input{:type=>"submit", :name=>"#{#theLinks[x].url}", :value=>"Name: #{#theLinks[x].Name} Study Time: #{#theLinks[x].studyTime} Comments: #{#theLinks[x].comments}"}
Basically, for each person, list the time they participated in a study and the comments on the study. Right now, this renders as a set of buttons. I'd like to render it as a table, with each row clickable in the same way (ie, using the 'post' method, so that only the haml file has to be edited without touching the rest of the files).
Ideally, I'd also like to be able to sort the table by name, time, or comments, but that might be getting ahead of myself.
So how can I change this list of buttons into a table with clickable rows?
Okay, how about this code? This makes a table with three columns, one for the name(clickable buttons like what you did), one for the time spent, and one for comments. Time and comments are just plain text, so only the name is clickable. In the future, if you want to add sorting, just convert the table headers to links that have ajax functions in them for sorting. I think jQuery has a function/plugin for sorting tables so you can just look into their doc(if you use jquery)
%table
%tr
%th Name
%th Time spent
%th Comments
- #theLinks.each do |link|
%tr
%td
%form{:action=>'/Download', :method=>"post",:enctype=>"multipart/form-data"}
%input{:type=>"submit", :name=>"#{link.url}", :value=>"Name: #{link.Name}}"
%td= "Study Time: #{link.studyTime}"
%td= "Comments: #{link.comments}"
Related
I have 5 calendars on same page, every one of them related to a different agenda. Only the day view is available.
I need to put an identifying header for each agenda, not just showing the day of week.
I don't know how to do this, any type of help will be appreciated.
Thanks in advance!
You can set the columnFormat option to control what's in the header for a particular day.
If you want custom text in there (i.e. not just date formatting strings) then you can enclose any text like that within square brackets.
For example
columnFormat: '[Hello, World!] dddd',
would result in something like "Hello, World! Thursday" (depending on the day of the week, obviously).
See https://fullcalendar.io/docs/text/columnFormat/ for more detail.
I have a DataTable that I'm passing to a FlexCel report. It contains a variable number of columns, so I'm using the Full Dataset feature (e.g. <#table_name.*>).
However, only a subset of the fields are dynamically generated (I have a variable number of attachments). The column name for each attachment field starts with a common word (e.g. "Attachment0", "Attachment1", etc).
What I would like to do is output the known finite set of fields and then the variable number of attachments. It would be nice if I could write something like <#table_name.Attachment*> (and <#table_name.Attachment**>). Is there any way in FlexCel Reports I can achieve the same result?
A side benefit to such a solution means that I could keep the formatting for the known/finite set of fields.
Update
I added place holder columns to the document, each with a <#delete column> tag, so that the un-wanted columns/data are removed.
Although this works, it's not ideal. For example, if I want to see how the columns fit in the page width (in print preview), then I need to hide the columns. Then I have to remember to un-hide them again, so other developers can see/understand my handy work.
It would be much more straight forward if I could filter the fields before they're output to the document.
I realised there's an alternate way around this problem. I broke up the data into two sets of data - <#table_name.*> and <#table_name_attachments.*>.
The fixed set of fields are in the first table and the variable set of fields is in the second table (all the "Attachment*" fields). When the report is run, I place them next to each other (in the same order) in the same worksheet. This means I have two table ranges - "_table_name_" and "_table_name_attachments_" on the one sheet.
Now I'm able to run my print preview without hiding/re-showing the columns-to-be-deleted. I've also eliminated human error - it was all to easy to accidentally set the wrong number of padded/delete columns.
I need to create a donor summary report that provides total donations by donor by year.
I need to provide
name address email yr1total yr2total etc...
It looks like salesforce only allows two columns in row headings and two columns in column headings. Is there a way to work around this
Or, is there a way to use the tabular report to do the same?
TIA
If donations is a single field on the donor's record, it seems like what you're looking to do is attempt to display two columns for the same data within a report. The best way to do this (well, outside of creating a master-detail relationship with a new custom object named "Donations") would to have formula fields for each of the donation years, and calculate the donation sums in each of them. That is, as long as you have a way of calculating the year of the donation.
I believe to get the best answer, more information is needed.
Something like this? This will work if your donation is a separate object that's linked to Account (I've used Tasks & Events linked to Accounts in my example).
Create a report in "Matrix format".
Drop Account Name on the left pane, Donation's Date on the columns.
Columns will default to days. Click the dropdown in the place where I have "Created Date" and select summarizing by year (of course fine-tune to whatever you need).
Check date ranges / filter criteria etc obviously if you don't see all data.
Click Show -> Hide details.
Drop your "Donation Amount" or similar field into place where "Record Count" is displayed. Use "Sum".
Optionally deselect Show -> Record Count.
Now you're mentioning that there are only 2 columns so you probably already tried this. Well, common trick is to cheat by using a formula field that would hold your data (separated by comma maybe?). Tabular report would require you to create some helper fields (1 per year) on Account and do some kind of rollup summaries, messy.
If it's for a dashboard you could play with summary report (it can have more groups than 2) and pick chart type table on the dashboard...
My project is in Asp.Net Webforms using C#.
On one of my web pages, I want to have two tables. One is going to be a summary table and the other a more detailed breakdown of the summary. When the user clicks on one of the rows of the summary table, I want the corresponding breakdown rows to appear in the breakdown table.
These tables can have anything between 60 and about 500 rows.
I have thought of two possible ways of doing this and I'm not sure which is best, or if there is another, better way of implementing this:
1) When a user clicks on one of the rows in the first table, a postback event happens, and the data for the second table is loaded from the code behind.
2) When the webpage is loaded for the first time, both tables are filled with all of the possible data, but all of the rows in the second table have the "display: none;" CSS attribute. When a user clicks on a summary row, the CSS of the corresponding breakdown rows is changed using JavaScript.
I'd go with your first thought and perhaps either
load the data for the second table through an AJAX request returning only row data in JSON (or maybe even the HTML for the table)
use an UpdatePanel
if the user only needs to view the data, I would go for the former, but if they need to edit the data in some way, I would probably choose the latter (even though I'm aware that UpdatePanels are effectively a full postback in async clothing, I feel their use can make the UI more fluid).
You could also make an AJAX call when the user clicks on a row in the summary table to return the data for the 2nd table.
second way no way, loading all of data and then hiding showing is not a good idea, it will be slow and if you add more functionality it will only get in your way...
I recommend this two approaches:
1)first table with pagination
click on row triggers ajax call to page method
page method return second table
here, you can see how to that:
http://encosia.com/2008/02/05/boost-aspnet-performance-with-deferred-content-loading/
2)using of uframe
http://labs.omaralzabir.com/UFrame2005/
cheers
I have a content type with a date field which can have multiple values.
How can i select the dates in Views for each month separately, beginning with the current month and have table columns titled with the month names?
Views can filter the appropriate nodes easily enough using "filters" and "sort criteria" in the views UI.
But, you probably won't be able to get a table-based view of the nodes in table form without developing a custom module or theme function to render the table HTML. There's really no easy way (that I know of) to turn a specialized query into an HTML table without digging into PHP and iterating through query results.
More info on developing modules is at http://drupal.org/node/508
And is it posible to do it by selecting the date field six times and passing six arguments?