I want to show holidays and weekends (Fridays & Saturdays) in custom style. Is there any attribute provided by PrimeFaces to do this, or what should I do to build a custom component from existing <p:calendar>.
Without using javascript or jquery.
Thanks in advance.
Regards,
Sunny
I think can achieve without writing a custom core custom component.
Create a composite component and use java script to highlight the custom dates you are interested in.
onClick(call the below function on P:cal)
function updatedaysHighlighter(){
var rows = document.getElementById('ui-datepicker-div').getElementsByTagName("tr");
if(days.length>1) {
alert(days[4].innerHTML);
}
}
You can try playing with td and update the class value for each td as like you want.
Its not supported by primeface...
There is a New Feature Request about this exact feature , and one of the comments requested holidays too
You can vote for it Issue 1805: New feature for Calendar: receive a list of Dates to highlight them
But in the meanwhile you better do it yourself using jquery (highlight holidays in datepicker jquery)
Related
i want to insert a calendar in java wicket 6.19.I should be able to add events on specified dates.Is this possible?
You can simply add or wrap org.apache.wicket.extensions.markup.html.form.DateTextField to choose some date but of course you have to handle it yourself.
Nice way can be get some nice jquery calendar component and wrap it in your custom wicket component.
screenshot1
screenshot2
I want a custom calenderview like these images and when we tap on any date it should show the selected date. I have done a lot research on this but I could not find any way to make a calenderview like this. please help me out, Thanks in adavnce.
Take a look at this library - https://github.com/prolificinteractive/material-calendarview
It's got exactly what you need.
Use DateTimePicker library, more details here :
DateTimePicker
My target is to display an abbreviation list with two entries per line: the abbreviation and the corresponding long version. For a nice layout I used a GridPane because of the vertical alignment over all entries - it's nice to read.
But I also want to scroll to the clicked abbreviation and set the focus on it like in a ListView version of it.
For example the # on page links in good old HTML. Is there another javafx layout element I miss to achieve this?
I don't believe there is a provided control that will work for the specific scenario you are describing. However, I think one of these options might work for you...
Use the TableView control and add two columns for the information you want to show (one for the abbreviation and another for the long version). TableViews also have the scrollTo and setFocus functionality you're looking for. Here is a good resource to get you started with the Tableview control. You can also style the Tableview with CSS to look less like a table and more like a list if thats what your intention is.
The second option is to set a custom cell factory on your ListView that builds custom cells using HBoxes, VBoxes, Labels, etc. to achieve your desired look. You would also want to use the cell factory to populate each ListView cell with an object that contains both the abbreviated text and long version text. A couple good resources, 1, 2
Although I think both option will work fine, I would suggest option 1 since in option 2 you are sort of building a table type structure anyway. I hope this is helpful!
Am working on a time sheet application with struts 1.2 and implementing jquery inside it. would appreciate greatly if i could get reply quickly ... am in learning curve in both jquery and struts ...
Requirement is this :
On the (+) button insert a row which populates dynamically and has two timepickers in it one used for determining timefrom, the other timeto, based on which duration is to be calculated. before clicking on (-) button user needs to check atleast one row for deleting that record. below are the screen shots.... the timepicker plugin i used is trentrichardson's. is this possible using jtable ? or jqgrid too ?? guys advise ...
i worked it around using some of the ideas from the other users. from a newbie on struts and java perspective i found that in struts tag library id and class are given as styleId and styleClass respectively.
eg:
is written as :-
Though am still interested in knowing whether the below can be corrected further ...
http://jsfiddle.net/manmohan_menon/6YkyY/4/
any advise will be greatly appreciated... thanks! :)
I want to implement some functionality--there are multiple rows with a checkbox at the starting in a jsp file in struts2.1 framework. If the checkbox is checked then at the same instant the color of that row should change, like it is selected. How should I implement this?
I recommend the jQuery plugin – tableRowCheckboxToggle (demo)
I agree with lschin; use a canned solution.
That said, you could also do it "manually" using jQuery or similar. Attach an onclick handler to each checkbox that sets a CSS style on its containing row.
Simplistically, use the checkbox's onclick attribute to provide a click handler and an ID that can be used to find the containing row.
Less obtrusively (and arguably better all around), find the row containing the checkbox by walking up the DOM (in jQuery, something like inside the attached click handler: $(this).parents("tr")[0]) and don't worry about throwing around a lot of IDs.