In AngularUI's nggrid, Edit On Focus Cell Selection Example does not .... edit on focus - angular-ui

Ng-grid has this example on its page,
titled : Edit On Focus Cell Selection Example
the pluker is : http://plnkr.co/edit/mfIWpK?p=preview
I don't see any editing being triggered.....

The attribute has changed in the latest version 2.0.0. It is now
enableCellEdit: true
http://plnkr.co/edit/EzCZcM?p=preview

Related

Disabling nextcord button

As title says, I'm trying to find a way how to disable the button for the person, who already interacted with it.
Like when it reaches 5 interactions, it turns green. I had checked the GitHub official Nextcord repository and found the counter.py file, which includes the changing button color after the number of interactions. But I still need to find a way how to disable it for user who already interacted. Thanks for any help!
Simply set the disabled property to True and edit the message with the new view.
If using the decorator in a View class it would look like this
button.disabled = True
await interaction.response.edit_message(view=self)

How to introduce additional fields with default values in AEM Touch UI dialogs?

Situation:
We have an AEM 6.4 Touch UI dialog and a number of existing component instances that were created through this dialog.
Now we want to add an additional boolean property (checkbox) to the dialog.
The default value of the new property should be true / checked.
Expected Result:
When an editor opens the updated dialog for an existing component, I would expect that the dialog shows the new checkbox checked since this is the default and the JCR contains no value for existing components.
Actual Result:
The dialog shows the checkbox unchecked for an existing component that has no value for this property in the JCR.
Surprisingly, the dialog shows the checkbox checked for a freshly created component!
Any ideas? Thanks.
Snippet of the checkbox inside the .content.xml file below.
<newProperty
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
checked="{Boolean}true"
name="./newProperty"
text="The recently added new property"
uncheckedValue="{Boolean}false"
value="{Boolean}true"
/>
It certainly will require a JS validation, since the absence of the value is falsy for the dialog.
Your example should always work, no need for extra js or properties. When you say there is no existing 'value' for this property, do you mean this property is not there or it is empty? Because an empty property would still have a value, in this case an empty string, resulting in it being read as false and the checkbox being empty. A new componenty does not have this property, resulting in the default being shown. If this does not work as designed, could you extend your example by adding all current properties of the component?
#John Goofy - you just need to add below property
'ignoreData={Boolean}true'
then, your node becomes
<newProperty
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
checked="{Boolean}true"
name="./newProperty"
text="The recently added new property"
uncheckedValue="{Boolean}false"
value="{Boolean}true"
ignoreData="{Boolean}true"
/>
please let me know, if it doesn't work for you.

How to display ipywidgets.Dropdown without a value selected

No question anymore. The problem is older ipywidgets version behaviour that looks to be fixed in version 7.
The ipywidgets.Dropdown on its own picks up the first value out of the options list.I would like to display the widget without a value selected.The first value in the list is a pointless default that still needs to be reflected down the workflow path. I read a discussion where a developer went as far as adding empty string item into the list. That fixes the dropdown look (to some extent though as the placeholder attribute is still ignored) but adds a silly selectable empty item to the dropdown list. Adding dummy "None" item to the list is not much better solution.Setting value to None results in the "Invalid selection" exception.I do not understand why the ipywidgets.Dropdown does not follow approach of the simpler widgets where empty value is allowed and placeholder text is dispalyed to prompt the user to select something.Is there a way to make the widget selection not required? Some attribute setting I am not aware of? If that is impossible then what is the simplest possible workaround?
You can just set the dropdown value to None:
import ipywidgets as widgets
d = widgets.Dropdown(options=['hello', 'world'], value=None)
d
in 'ipywidgets' version 7.2.1 you will need to disable user changes to be able to display the widget by setting it to False like this:
d = widgets.Dropdown(options=['hello', 'world'], value=None, disabled=False)

XPages and Dojo Radio Buttons

I using some Dojo radio buttons in an XPages application and would like to display the label, not the selected value, when the XPage is in read mode. Is this possible? Here is an example of my code:
<xe:djRadioButton id="C1B1_R1" groupName="FKRadio1" value="#{document1.C1B1_RValue}">
<xe:this.label><![CDATA[#{javascript:sessionScope.get("C1B1_R1")}]]></xe:this.label>
<xe:this.selectedValue><![CDATA[#{javascript:sessionScope.get("SV_C1B1_R1")}]]>
</xe:this.selectedValue>
<xe:this.rendered><![CDATA[#{javascript:var r3 = sessionScope.get("C1B1TextVisibility");
#If(currentDocument.isEditable(),#If(r3 != null && r3[0]!=0,true,false),
#Trim(#GetField("C1B1_RValue")) == sessionScope.get("SV_C1B1_R1"), true, false)}]]>
</xe:this.rendered>
</xe:djRadioButton>
In edit mode, the labels are displayed. However in read mode, the value of the field is displayed rather than the corresponding label for the field value. In this case, the values are all numeric while the labels are text.
Tony,
Three things that you should try, these are written in order you should try:
1) I think it is rendering as just plain text when in read mode, so it just shows the values. Try setting the "Show disabled control for read only" and see if it renders it as something other than plain text.
2) Change the code to be the same for read or edit mode, in other words make it like edit mode. Then use the styleClass to use jQuery or CSS to restrict editing.
3) Use a hidden input/display:none to load the field on the page, then set the label to a field that is shown
You can hidde the djRadioButton in read mode, and show a xp:text with the label instead.
Or, maybe with the property "Show disabled control for read-only" (in general properties of the Dojo Radio Button)

read-only cells in ipython/jupyter notebook

Is there a way to mark a cell in the ipython/jupyter notebook readonly using the json format in the ipynb file? (E.g., a cell attribute "readonly":false or some such.) If not, is there a jquery hack to find suppress the double click event in the cell?
#Richard Ackon's answer requires adjustments for JupyterLab:
Open the Property Inspector.
Focus the cell you want to lock.
Add the following lines to the Cell Metadata:
{
"trusted": true,
"editable": false,
"deletable": false
}
Click on the tick to save the metadata... Tadah!, your cell can't be modified or deleted.
The Property Inspector comes built-in since JupyterLab 2.0 (note it was moved to the right sidebar by default in JupyterLab 3.0). For older JupyterLab versions you would need to modify the notebook file manually.
Unfortunately, the outputs can still be cleared by intentionally selecting that option in the menu bar (Edit > Clear Ouputs). Of course that can only happen if you DO WANT to clear the outputs and not just update them by running the cell.
Source
Yes, Use the steps below:
Select view on the menubar
Point to Cell Toolbar and select Edit Metadata
An "Edit Metadata" button will appear at the top-right corner of the cell.
Click on that button and edit the json that pops up. Set the editable key to true or false to get the desired effect.
The JSON will look something like this:
{
"deletable": false,
"editable": false,
"scrolled": true,
"trusted": true
}
There is an extension for IPython that is supposed to that:
Read Only Cell extension.
Getting it to work is something else, but it is there.

Resources