I have requirement that sap.m.DatePicker should prevent alphabets but accept numbers. And the maximum input length should be 10.
When two digits entered for date, e.g. "10", a dot (".") should be automatically added. Also month. At the end, it should look like "10.12.2019" in DatePicker. I guess it would be possible with liveChange event, but DatePicker doesn't have liveChange.
Please let me know how to add custom liveChange event in DatePicker. It would be great help.
Currently (as of SAPUI5 1.64), there is no event such as liveChange for DatePicker. To add this functionality, you can create your own control and let it extend DatePicker. Then add the control to your view, attach an event handler and update the DatePicker's value using DatePicker#setValue.
You can take a look at
how to create a custom control in SAPUI5 here.
the liveChange implementation of sap.m.Input here.
The maxLength property of the input will be set by SAPUI5 automatically if you specify the DatePicker's property displayFormat, in your case dd.MM.yyyy.
OpenUI5/SAPUI5 1.104 adds the liveChange event to the following controls:
sap.m.DateTimeField controls, e.g.:
sap.m.DatePicker
sap.m.DateTimePicker
sap.m.DateRangeSelection
sap.m.TimePicker
sap.m.MaskInput
See commit: 72fdbf4.
Related
Link to original post
Here is what I am facing.
I am using the 'sheet selector' technique to switch between two sheets and the sheet selector parameter is the 'PY' and 'Date Range' option.
I also want to hide the corresponding filters along with the sheets.
When I pick PY - the checkboxes will be displayed.
When I pick date range Rebate Commit Date will be displayed.
I was able to successfully hide PY option by setting it to 'Only relevant values'.
However that is not working for date range
So I used a floating object in a vertical container to hide the date range.
It is hiding successfully but when I need to access date range am not able to do that because of the floating object on top.
Any ideas are highly appreciated.
Thank you.
Answered in tableau community - Link
I want to initialize and destroy datepicker in materializecss. I know how to initialize but unable to find it how to destroy.
I have one textbox and one dropdown.based on dropdown, the textbox type is changed. so when user select dob, I initialized textbox with materializecss datepicker but after that I am not able to change textbox back to its normal mode, I mean where user can insert text or number.
I am using below code to initialize -
$('#txtDatePicker').pickadate({
selectMonths: true, // Creates a dropdown to control month
selectYears: 100 // Creates a dropdown of 15 years to control year
});
A datepicker usually has 3 buttons, however if these buttons are initialized without values ie. today: "" they will not be shown.
$('.datepicker').pickadate({
today: '',
clear: 'Clear selection',
close: 'Cancel'
});
For more information see: http://amsul.ca/pickadate.js/date/#buttons
From your comment
so lets say you have initialized date picker and now I want to destroy it, so that simple text can be written into it.
I think that if you only need a simple text can be written into it. Just add an option like this
$('.datepicker').pickadate({
editable: true
});
Is there any way to change the date (value returned by getDate) pressing the change month arrows without using setDate?
It's not much clear your request..try to specify better; anyway see the documentation about datepicker https://jqueryui.com/datepicker/#dropdown-month-year
I have a situation here: I have a form field with trigger xtype, what I want to happen on my trigger function is to open a window with a list or grid of data in it. I want to get the value of those data and assign it as the value of my form field with trigger. Can anyone help me solve this problem. Thank you very much.
You have multiple solutions for this.
You can make use Saki's simple message bus to do the communication between extjs components.
You can create an custom event for your trigger field. When user selects a record in your window, fire the event with the selected record.
Inside your onTriggerClick :
Display your window with grid / view for user selection
Inside your Window (on some submit button):
onSubmitClick: function(){
// Get the selected record & fire event
var selected = grid.getSelectionModel().getSelected();
triggerFieldObject.fireEvent('recordSelect',selected);
}
Inside your event processing (Will be on TriggerField):
onRecordSelect: function(record) {
// Now you have access to the selected record.. process it,
// Set the trigger field value etc
this.setValue('Your Value for Trigger Field');
}
Note: This is a skeleton code and not a complete solution. You will need to add your code according to your requirements.
I have a data-grid and three column in it. one column is type of DataGridViewComboBoxCell, three items are in this grid combo box, now i have to invoke selection index changed event to change value according to combo value change in grid.
also help me to make a new event ....
please help...
thanks
I really can't understand your question.
But maybe these informations can help:
A ComboBoxColumn has always two kinds of controls. A presenting one (in most cases a label) which is individually for each row. And a editing one that will be shared for the whole column. So take a look into this documentation and the IDataGridViewEditingControl Interface.
Maybe these will give you a starting point on how to solve your problem.
In the Load event for the form, you need to get the cell that you want to add the handler to and cast it as a regular combo box. You can then add the event handler on SelectedIndexChanged, but it must be done programmatically, and depending on the language you are using.