EXTJS: Month/Day Selector (ie. no year) - extjs

I am currently using a EXTJS EditorGridPanel in my application, and for one of the column inputs I require the user to be able to pick a month and day (no year).
I am currently using a DateField to do this, but I need to be able to disable the "year" aspect of it in the UI. I do not care if the "value" in the end has a year associated with it, I can simply disregard it. I have searched to see if anyone has done such a thing, but my only findings are people that way to show only Month/Year.
My other option is to create my own custom input (with comboboxes for month and day, where the day combo changes based on the month), however, I honestly don't have all that much time to make one myself as I would have to go through the learning curve since I have never created a custom input extension before.
--> So my big question then is, has anyone heard of an existing EXTJS month/day picker?
Any help would be much appropriated stack overflow peoples!

Although I would probably create my own custom component to use as the editor, if you're not comfortable doing that, have you considered breaking the Month and Day fields into separate columns in your grid column model?
Another option would be to add a input mask to the textfield (you'll need to specify one as a customEditor in your cm). I believe this is done via custom vtypes. This input mask would force the user to enter the date in the format that you specify.
Using this approach would :
keep all month/day data in one column
simplifies your UI code by using the out-of-the-box components. (IMO this is key for learning ExtJS)

try this one
picker: {
slotOrder: [ 'month', 'day' ]
}
Your post appears to contain code that is not properly formatted as code. Please indent all code by 4 spaces using the code toolbar button or the CTRL+K keyboard shortcut. For more editing help, click the [?] toolbar icon.

Try something like:
{
xtype: 'datepickerfield',
name: 'OrderDate',
label: 'Order Date',
picker: { yearTo: 2011, yearFrom: 2020 }
}
I hope this will help you.

Related

Activating enterprise adds "breaking changes" on filter. How to avoid?

Normally in Development activating features should be "on demand" to avoid having to change undesired breaking changes.
This is different in ag-grid. When ONLY activating the license it adds features - which we don't want. We want to activate them explicitly. Now we basically have to change a lot of things.
The actual question at this moment
Without enterprise you have the simple filters, they look like this (we just changed a few styles)
Now when activating ONLY the license it suddenly changes to this (a top menu with 3 options of which the middle one is the filter which looks obviously odd because we didn't style it yet as we neither want nor need it):
Now not only a new menu appeared but also the SimpleFilter changed to unwanted Set filter. I overcame the Set Filter by explicitly recreating the SimpleFilter like this
{
filterOptions: [
SimpleFilter.CONTAINS,
SimpleFilter.NOT_CONTAINS,
SimpleFilter.EQUALS,
SimpleFilter.NOT_EQUAL,
SimpleFilter.STARTS_WITH,
SimpleFilter.ENDS_WITH,
SimpleFilter.BLANK,
SimpleFilter.NOT_BLANK,
],
defaultOption: SimpleFilter.CONTAINS,
}
We were confused that there isn't a ready-to-use flag/preset...
But furthermore we don't want that 3 option bar. We just want the old version of this menu! How can this be done?
In the column menu you can select which tabs to show using the column definition menuTabs property.
If you only want to show the filter tab in the column menu for the COUNTRY column, use this column definition code:
{ field: 'country', filter: 'agTextColumnFilter', menuTabs: ['filterMenuTab'], }

ReactJS - make text input that contains tags and free text as template

I'm researching an easy way to make a free text input that can also contain multiple replaceable tags to create templates. As on this picture example
In that picture, the information witch player (tag) made the goal would be stored.
Later I would reuse that template and replacing the tag by a value.
Like: Goal of Iniesta, Goal of Rivaldo, ...
I couldn't find a lib that would do the job. The few attempts that I made to try to resolve it lead to extremely complex inputs with redefining selects (onClick, onKeydown, onSelect, maintaining current select) as the user can't edit the tag by hand (they are trigger by clicking buttons).
Does somebody already had to handle this kind of input?
Edit: As my question seems to be not clear, I will add a few details.
In fact, the input should work as it is a free text input but should also allow adding tags/chips that are provided by external triggers (onClick buttons)
Example: I will make [activity] on [day]
First I type "I will make " then I click the button "activity" that will add a "activity" tag/chip to the input. I continue with typing " on " and finaly click the button "day" to add the tag "day".
Then I will store this as template and reuse it in several scenarios by replacing the tags. Like:
I will make sandwiches on Monday
I will make sport on Friday
If somebody else have the same issue. I finally found the right lib Tagify. It has a mixed mode (text + tag)

Making an Access Filter-Macro Based on Text-Field Input

I've been wracking my brains on this simple macro for days and troweled almost every site and forum for an answer, to no avail. Thus, I come to the gurus of stackOverflow for my salvation:
I'm working in Access 2010 and have a database of events that are coming up. Right now the database opens to a form wherein any user may view the entered events and edit them if there's an error. Likewise, there's a report that pulls it's list from the form that everyone's working on.
What I'd like to do (for ease of use) is have a text field and a button. The field would be for date-input (i.e. 10/20/2015) and when pushed, the button would filter the list of events to show only things on or after the typed date. Likewise, I'm hoping to make another filter for the report that will display items only btw. certain dates (but I'm really just working on the first item).
The concept would look like this:
| [ Text Field | [BUTTON]
Event 1 ...................... Date.........
Event 2 ...................... Date.....
....
..
.
Note: This is a database for people who know NOTHING about Access, so I'm trying to spoon-feed the stuff they need to them.
I really appreciate the help, folks.

drupal 7 create a views block that displays based on date range of current node

I've searched for days and not found a clear answer for this.
I'd say I'm intermediate with Drupal (at best). I'm using Views, Panels, CCK, and the Date modules (among others, that may not relate to this question)
I've got a content type of Shows (plays), that has a date range field (from the date module) that is the run date of the show.
I've got 3 views blocks that I filter using the Content: Show Dates - start date and Content: Show Dates - end date fields. These display a list (links) to shows that are of 3 categories, now playing, upcoming, and past shows. They work fine.
Now for the tricky part (for me). I want Panels (Node rewrite for Shows) to decide which one to display in the sidebar while looking at a Content:Show based on whether it is currently running, yet to run, or in the past.
What are the steps to make this happen?
thanks!
jason
Edit: I'm working with Blocks too.
I would suggest to create 3 views (not necessary blocks if you have enabled the "Views content pane" module), one for each date option with a nid as Contextual filter and a display of Content:Node. Then add all the 3 views in one panel page variant one after another. Probably you already have these blocks. So you can clone them and just add a nid Contextual filter.
Another option is to create 3 different variants for the same node type and add a Selection Rule for the Show Date field (Selection Rules screencast). If there are no filters for the date field add some php code. Here is an example.

Atk4 form Columns

I'm trying to use columns in a form.
I have the next code, that produces the
The code is this:
$col=$this->add('Columns');
$left=$col->add($f->addField('text','observaciones'));
$right=$col->add($f->addField('line','cantidad_de_bocas'));
the fields of the columns, are based on form fields. I whant to add more than one field to the columns (ex. 2 fields on left column and 4 fields on right columns).
I have seen some examples about this, like
$col=$page->add('Columns');
$left=$col->addColumn(2)->add('View_SlotMachine');
$right=$col->addColumn(2)->add('View_SlotMachine');
Why the fields are duplicated ?
What does the method addColumn(2) does ?
Very thanks
If you havent gone to far with development using atk 4.1, you could download 4.2 and look at the examples here. There is a lot of new functionality in 4.2 which you can take advantage of and the demos and examples are being updated to reflect these changes.
In 4.2, there is an example of styling with two columns like this
class StylingForm extends Form {
function init(){
parent::init();
$f=$this;
$f->addField('line','name')->validateNotNull()
->setFieldHint('Click "Register" to see error');
$f->addField('line','email')
->validateNotNull()
->validateField('filter_var($this->get(), FILTER_VALIDATE_EMAIL)')
.. .. ..
}
functoin init() {
// Stacked class puts labels on top of fields
$form=$page->add('StylingForm');
$form->addClass('stacked atk-row');
$form->template->trySet('fieldset','span6');
$sep=$form->addSeparator('span6');
$form->add('Order')->move($sep,'before','age')->now();
}
In atk4.1, the form is a view so it has a template in atk4/templates/shared/view/form.html and some code in atk4/lib/View/form.php
In the example of the slot machine that you mention from here the addColumns(2) is being used to set the width of the views to 20% of the available screen width but in the example, each column will contain a view of the slot machine. If you wanted to forms on the same page, you could use the same functionality, but what you appear to want is a single form across two columns with a single submit button.
If you have to continue to use atk4.1, you need to look at the form.html. Romans may be able to suggest how you could create a two column form in that version. I can see there are some classes defined in the css such as atk-form-vertical-2col and atk-form-vertical-3col and there is a function setFormClass to set them but i cant see what tags you would set to put fields into the right hand side - by default, everything goes to the left.

Resources