Disable jsviews datepicker depending on another value - jquery-ui-datepicker

I need to disable a datepicker depending on the value of another property in the model.
How can I achieve this?
I know i can disable it by setting _disabled=true|false but can I also include conditional expression and what is the syntax. I need to be able to react to the changes in the other property and have the date picker update disable state accordingly. The other property is a data linked select with numeric values.
Something like
{^{datepicker
_disabled="{:OtherProperty > 1}}
DatePickerValue
dataFormat="mm/dd/yy"
dateFormat="dd/mm/yy"
{{/datepicker}}"
Is this possible and how can I do this?

Yes, you can do that.
You can put an expression directly as a value of a tag property: _disabled=OtherProperty > 1 - which will initialize the value.
But by default, tag properties are not data-linked for dynamic changes. You have to opt in to that by prepending a ^. See Binding to named properties of tags, and also the section Data-linked option here
See for example the dynamic binding of ^_numberOfMonths=... in the Datepicker variants sample.
So in your case you need something like:
{^{datepicker
^_disabled=OtherProperty>1
DatePickerValue
dataFormat="mm/dd/yy"
dateFormat="dd/mm/yy" /}}

Related

Using jqGrid I need to Show a Hidden Column Based on UserData Parm

Using jqGrid 4.15.6-pre - free jqGrid
I am wondering why the following code will not show the specified column.
var cm = $('#nrtslist').jqGrid('getColProp','override');
cm.hidden = false;
This can't be done this way.
All the concept of the grid is that you can read the properties of colModel or any other grid option, but changing it does not mean that it will change something. With other words something must happen in order to change the property.
These properties describe the current status (in most cases) or this is a consequence, not a cause.
To change something in grid you will need to use the appropriate method or do your own one.
In your case you will need to use the showCol or hideCol methods
$('#nrtslist').jqGrid('showCol','override'); // this will show the column
$('#nrtslist').jqGrid('hideCol','override'); // this will hide it.

Oracle APEX - make a field conditionally required

I have an item that is displayed conditionally - based on another item selection. I want to make that item non-required when hidden. What is the best way to do that?
As you have probably found, you cannot just set the dependent item's Required attribute, as this makes it required even when hidden. Instead you can create a Validation of type "Item is NOT NULL" on the dependent item, but with a server-side condition based on the value of the other item.
For example, suppose the first item is P12_JOB and the second is P12_COMMISSION, and P12_COMMISSION is only shown when P12_JOB = 'SALESMAN'. Then this Validation will do it:
As you can see there are various settings available there that you should check are appropriate for you e.g. Always Execute, Display Location.

Nominal to binary conversion in weka tool

I was trying to preprocess Leukemia dataset which has two classes ALL and AML.I need to convert it into binary values. I used "nominal to binary" filter. But it does not convert it to binary values. My weka version is 3.6.11.
Well, on my 3.6 version of Weka, it is working.
1. Load the file on Explorer.
2. Go to Filter->Weka filters ->unsupervised->attribute->nominalToBinary.
3. In the attributeIndices, indicate the "nominal" attribute index that you are trying to change to "binary".
4. Leave all other options to default. Click OK.
5. Click apply.
To get the NominalToBinary filter to work on the class attribute,
make sure the attribute selected in the class dropdown is changed to another attribute, temporarily, then you can switch back after applying the filter.
Weka apparently does not let you apply the NominalToBinary filter on the selected class attribute.

Infragistics UltraGrid - How to use displayed values in group by headers when using an IEditorDataFilter?

I have a situation where I'm using the IEditorDataFilter interface within a custom UltraGrid editor control to automatically map values from a bound data source when they're displayed in the grid cells. In this case it's converting guid-based key values into user-friendly values, and it works well by displaying what I need in the cell, but retaining the GUID values as the 'value' behind the scenes.
My issue is what happens when I enable the built-in group by functionality and the user groups by a column using my editor. In that case the group by headers default to using the cell's value, which is the guid in my case, so I end up with headers like this:
Column A: 7F720CE8-123A-4A5D-95A7-6DC6EFFE5009 (10 items)
What I really want is the cell's display value to be used instead so it's something like this:
Column A: Item 1 (10 items)
What I've tried so far
Infragistics provides a couple mechanisms for modifying what's shown in group by rows:
GroupByRowDescriptionMask property of the grid (http://bit.ly/1g72t1b)
Manually set the row description via the InitializeGroupByRow event (http://bit.ly/1ix1CbK)
Option 1 doesn't appear to give me what I need because the cell's display value is not exposed in the set of tokens they provide. Option 2 looks promising but it's not clear to me how to get at the cell's display value. The event argument only appears to contain the cell's backing value, which in my case is the GUID.
Is there a proper approach for using the group by functionality when you're also using an IEditorDataFilter implementation to convert values?
This may be frowned upon, but I asked my question on the Infragistic forums as well, and a complete answer is available there (along with an example solution demonstrating the problem):
http://www.infragistics.com/community/forums/p/88541/439210.aspx
In short, I was applying my custom editors at the cell level, which made them unavailable when the rows were grouped together. A better approach would be to apply the editor at the column level, which would make the editor available at the time of grouping, and would provide the expected behavior.

Add Dropdown to infragistics WebDataGrid in Edit mode

I have two issues:
I have a complex object with Id and Text underneath. For display, I am using TemplateDataField with eval function. Can I bind the complex object to a BoundDataField?
The reason behind binding the complex object to BoundDataField is, I need to make it editable grid. I could not find any documentation or samples which uses Template field, and make that column editable. (I agree it might not be possible.) Now I need to put a dropdown, where user selects a value and I can assign it to the id field of my complex object. I am able to put a dropdown (using EditorProviders) to a bounddatafield, but how can I do it for the template data field described above?
Here is a link to the samples of Editing WebDatagrid: Controls & Application Samples
When using a TemplateDataField you are specifying what you want to use as the template and you can put an editor in that Field. Note that if you do put an editor in that field, you need to handle updates to the grid's value or list that your grid is bound to.
Note that if the values in your drop down have an id associated with them and that can be the value of the grid cell it would be better to use the DropDownEditorProvider with the grid having a bound field where that field is the id of the item that you are selecting.